-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
by cudmore.mb:
*What steps will reproduce the problem?* 1. Format http://play.golang.org/p/jzmwwldMwt 2. Format *What is the expected output?* {{{ type Field struct { ID `json:"UID"` // comment Label ID `json:"Lbl"` // comment *N // comment Value string `json:"Val"` Inheritable `json:"Inh"` // comment a int // comment b string c int // comment } }}} *What do you see instead?* {{{ type Field struct { ID `json:"UID"` // comment Label ID `json:"Lbl"` // comment *N // comment Value string `json:"Val"` Inheritable `json:"Inh"` // comment a int // comment b string c int // comment } }}} *Which version are you using?* go1.2 I opened a discussion on this here: https://groups.google.com/d/topic/golang-nuts/5RlC11J7XNE/discussion It would be great if go fmt would align the parts of field definitions by kind (type, tag, comment), rather than by index (first parts align, second parts), across contiguous field definitions until an intermittent newline or comment. The type of anonymous fields would be regarded as the field name, and would not contribute to computing the alignment of the types. All types in a contiguous list of fields would align to the rightmost, and then all tags, and then all comments. However, this does get tricky: http://play.golang.org/p/Z_OPEbej-v
Metadata
Metadata
Assignees
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.