Skip to content

Latest commit

 

History

History
7 lines (5 loc) · 254 Bytes

best-practices.md

File metadata and controls

7 lines (5 loc) · 254 Bytes

Best practices:

  • Use defer whenever possible

Errors:

  • Export/Return error as variable, it helps you to compare error easily, instead of comparing strings.
  • Another way is to create a custom type to encapsulate message and defining error codes.