Coldfire icon indicating copy to clipboard operation
Coldfire copied to clipboard

Code improvements

Open shanduur opened this issue 4 years ago • 0 comments

TODO:

  • [ ] error propagation
  • [ ] logging errors
  • [ ] documentation string over exported functions
  • [ ] documentation string on package

As listed in the TODO list above, some of the parts of code are inconsistent.

  1. You should consider using tools like go vet, go fmt and go imports.
  2. Unexported methods should be used.
  3. Exported methods should contain doc comment.
  4. If this is module/library/framework, then you shouldn't log inside the functions, but return errors with additional info.
  5. If some part of code should run, and fail if error occurs, name function according to the scheme MustDoSomethin() and then panic on error. Note that in doc comment.

shanduur avatar Mar 29 '21 12:03 shanduur