blob: 1e49e3884d74be9f03f1ad80e20be537161a4ce4 [file] [log] [blame]
Test case for golang/go#59554: data corruption on formatting due to line
directives.
Note that gofumpt is needed for this test case, as it reformats var decls into
short var decls.
Note that gofumpt requires Go 1.18.
-- flags --
-min_go=go1.18
-- settings.json --
{
"formatting.gofumpt": true
}
-- main.go --
package main //@format(main)
func Match(data []byte) int {
//line :1
var idx = ^uint(0)
_ = idx
return -1
}
-- @main --
package main //@format(main)
func Match(data []byte) int {
//line :1
idx := ^uint(0)
_ = idx
return -1
}