Bahlo's Style Guide #44

Open
opened 2021-06-20 20:40:59 +00:00 by jeff · 0 comments
Owner

https://github.com/bahlo/go-styleguide

Add context to errors. After reading the logs, this will significantly cut down debugging time.

Use structured logging.

Avoid package-level variables. If you do use one, put it at the top of the file.

Keep the happy path left.

Avoid mocks.

Avoid side-effects and favor pure funcs.

Avoid naked returns. Use named return variables for documentation only.

Put main as the first func.

Avoid generic package names such as "helper" and "util".

Avoid using the keyword "new".

https://github.com/bahlo/go-styleguide Add context to errors. After reading the logs, this will significantly cut down debugging time. Use structured logging. Avoid package-level variables. If you do use one, put it at the top of the file. Keep the happy path left. Avoid mocks. Avoid side-effects and favor pure funcs. Avoid naked returns. Use named return variables for documentation only. Put main as the first func. Avoid generic package names such as "helper" and "util". Avoid using the keyword "new".
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: simplesystems/go-resources#44
No description provided.