You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a one-line function which is slightly longer than the ones surrounding it and
gofmt decides to break it up into three lines. I thought Go is not supposed to have a
line length limit and I have written longer lines (not one-line functions) than this in
the past which gofmt left as-is.
http://play.golang.org/p/1HPUqQ4wWc
WANT:
func (a abcdefghijkl) Less(i, j int) bool { return a.abcde[i].abcdefghijklm <
a.abcde[j].abcdefghijklm }
func (a abcdefghijklm) Less(i, j int) bool { return a.abcde[i].abcdefghijklm <
a.abcde[j].abcdefghijklm }
func (a abcdefghijklmn) Less(i, j int) bool { return a.abcde[i].abcdefghijklm <
a.abcde[j].abcdefghijklm }
GOT:
func (a abcdefghijkl) Less(i, j int) bool { return a.abcde[i].abcdefghijklm <
a.abcde[j].abcdefghijklm }
func (a abcdefghijklm) Less(i, j int) bool { return a.abcde[i].abcdefghijklm <
a.abcde[j].abcdefghijklm }
func (a abcdefghijklmn) Less(i, j int) bool {
return a.abcde[i].abcdefghijklm < a.abcde[j].abcdefghijklm
}
The text was updated successfully, but these errors were encountered:
Go does not have line length limits, correct. However IIRC, gofmt's decision when to
eventually break long lines in certain situations _is_ based on line length.
AFAICT #WAI
The text was updated successfully, but these errors were encountered: