Discussions in code reviews (example) have pointed us to private guidance indicating that line breaks in function declarations are bad Go style.
The guidance can be summarized as "The signature of a function or method declaration should remain on a single line to avoid indentation confusion." Unfortunately I've been unable to find a public discussion of this.
However, this (and similar declarations) suffers from excessive line length and obscures the number and sequence of arguments. Closer adherence to guidance to have short (one-character?) variable names might improve this, but possibly at the cost of overall readability.
Currently we have 46 instances of this style violation:
Discussions in code reviews (example) have pointed us to private guidance indicating that line breaks in function declarations are bad Go style.
The guidance can be summarized as "The signature of a function or method declaration should remain on a single line to avoid indentation confusion." Unfortunately I've been unable to find a public discussion of this.
An example violation is below.
Guidance claims that the following is more readable and preferred:
However, this (and similar declarations) suffers from excessive line length and obscures the number and sequence of arguments. Closer adherence to guidance to have short (one-character?) variable names might improve this, but possibly at the cost of overall readability.
Currently we have 46 instances of this style violation:
A similar count finds over 700 instances of this style violation in Kubernetes:
There are 20 violations in Hugo:
There are also a few violations in the Go source code, with three directly linked below: