Open
Description
A declaration of the form:
const (
Do = iota; Re; Mi; Fa; Sol; La; Ti;
)
gets formatted as:
const (
Do = iota
Re
Mi
Fa
Sol
La
Ti
)
The former is close to what in other languages might be achieved with an "enum" declaration. If there's several such simple const decls, the latter form uses undue amount of space w/o much readability benefit.
Consider recognizing this special case and not introduce line-breaks if there were none in the original source.
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
agnivade commentedon Apr 26, 2018
I can take a stab at this. @griesemer - Let me know if you already had something planned.
griesemer commentedon Apr 26, 2018
@agnivade You're welcome to investigate and play with it but I am probably not going to look at this (or any related CLs) any time soon. We have a freeze coming up on May 1 and this is not important at all and we many more important issues to tackle at the moment. Thanks.
agnivade commentedon Apr 26, 2018
Got it. Thanks.
gopherbot commentedon Apr 27, 2018
Change https://golang.org/cl/109795 mentions this issue:
go/printer: allow single-line const enum declarations
griesemer commentedon Sep 5, 2018
The pending CL seems ok but I think we need to determine if we actually want this change.