Idiomatic Go #41

Open
opened 2021-06-10 02:31:35 +00:00 by jeff · 0 comments
Owner

https://dmitri.shuralyov.com/idiomatic-go

Use consistent spelling

Single spaces between sentences

Start error values with Err

For brands or words with more than 1 capital letter, lowercase all letters

Comments for humans always have a single space after the slashes!!!!!
-- sub ref: https://golang.org/cmd/compile/#hdr-Compiler_Directives

Use defer if its overhead is relatively negligible, or it buys meaningful readability

Use singular form for collection repo/folder name

Avoid unused method receiver names

Use s == "" for the empty string check, not len(s) == 0

Put sync.Mutex in top of a block of fields that the mutex protects.

https://dmitri.shuralyov.com/idiomatic-go Use consistent spelling Single spaces between sentences Start error values with `Err` For brands or words with more than 1 capital letter, lowercase all letters Comments for humans always have a single space after the slashes!!!!! -- sub ref: https://golang.org/cmd/compile/#hdr-Compiler_Directives Use defer if its overhead is relatively negligible, or it buys meaningful readability Use singular form for collection repo/folder name Avoid unused method receiver names Use `s == ""` for the empty string check, not `len(s) == 0` Put sync.Mutex in top of a block of fields that the mutex protects.
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#41
No description provided.