-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Milestone
Description
tl;dr: Access http://play.golang.org/p/Ry5OUCK43C; Click Format; Click Format.
After running the following snippet through gofmt -w
:
package main
//line x:1
func main() {
}
The output is:
package main
//line x:1
func main() {
}
This output looks correct with a single newline between //line
and func main
. However if we run gofmt -w
again on the same file the output is different:
package main
//line x:1
func main() {
}
Now the newline between //line
and func main
was removed. This behavior is different from what would happen if instead of //line
we had a regular commented line.
This was tested both on master and 1.5.1:
$ go version
go version devel +97f854c Sat Dec 19 10:00:04 2015 +0000 darwin/amd64