The comment was indented one extra tab stop beyond where it should be by gofmt.
Deleting one of the tabs and running gofmt again results in the proper alignment.
Removing the statement below the comment and re-formatting will remove the extra tab stop.
Changing the statement above the comment so the "func" line is on the same line as the assignment causes the extra tab to be removed as well.
Also unexpected, and the reason the bug was noticed: gofmt converts two spaces into two tabs here, which causes an unfortunate interaction with xxx (when not in tab mode) and probably other editors -- if you attempt to remove the extra indent and then re-run gofmt, you may be led to believe it's impossible to get the comment to line up as desired/expected.
package p
func f() {
a =
func(T1) T2 {
return q
}
// Comment
b =
func(T1) T2 {
return q
}
}
The comment was indented one extra tab stop beyond where it should be by gofmt.
Also unexpected, and the reason the bug was noticed: gofmt converts two spaces into two tabs here, which causes an unfortunate interaction with xxx (when not in tab mode) and probably other editors -- if you attempt to remove the extra indent and then re-run gofmt, you may be led to believe it's impossible to get the comment to line up as desired/expected.