What version of Go are you using (go version)?
go version go1.9.2 linux/amd64
What did you do?
$ gofmt -r 'bar(x) -> bar(x)' /tmp/test.go
/tmp/test.go is:
package main
func main() {
// Call foo().
foo()
bar(func() {
// Call foo().
foo()
})
}
What did you expect to see?
Same contents
What did you see instead?
package main
func main() {
// Call foo().
foo()
bar(func() {
foo()
})
}
Notice the comment in the closure passed to bar was replaced with an empty line, and an empty line was added after the call to bar.
The identity rewrite rule is for simplicity, this happens with more useful rewrites that act on bar too.
What version of Go are you using (
go version)?go version go1.9.2 linux/amd64
What did you do?
$ gofmt -r 'bar(x) -> bar(x)' /tmp/test.go/tmp/test.go is:
What did you expect to see?
Same contents
What did you see instead?
Notice the comment in the closure passed to bar was replaced with an empty line, and an empty line was added after the call to bar.
The identity rewrite rule is for simplicity, this happens with more useful rewrites that act on bar too.