I encounter an issue with gofmt, where adding a comment to the first line causes extra indentation to the rest of the lines.
For example, giving this block of code:
func main() {
t1 := foo.Bar().
Baz().
Qux()
}
Adding a comment (//) after Bar() adds extra indentations to the lines below:
func main() {
t1 := foo.Bar(). //
Baz().
Qux()
}
Playground
Same for this case:
func main() {
t1 := foo.Bar(). // bar
Baz(). // baz
Qux() // qux
}
Playground
Maybe I miss something, but I expect the formatting to be as follow:
func main() {
t1 := foo.Bar(). //
Baz().
Qux()
}
func main() {
t1 := foo.Bar(). // bar
Baz(). // baz
Qux() // qux
}
I encounter an issue with
gofmt, where adding a comment to the first line causes extra indentation to the rest of the lines.For example, giving this block of code:
Adding a comment (
//) afterBar()adds extra indentations to the lines below:Playground
Same for this case:
Playground
Maybe I miss something, but I expect the formatting to be as follow: