If parameters of the same type lie consecutively, mention their type once at the end of the last parameter.
Error strings follow a set of guidelines to ensure uniformity and good composability. Quoting Go Code Review Comments:
It is recommended that the error variables that are part of an API should be named as errFoo
, ErrSomethingBad
, ErrKindFoo
or BazError
.
Package comments, like all comments to be presented by godoc, must appear adjacent to the package clause, with no blank line.
Per convention, a function's error value should be its last return value.