| 1 |
Test case for golang/go#59554: data corruption on formatting due to line |
| 2 |
directives. |
| 3 |
|
| 4 |
Note that gofumpt is needed for this test case, as it reformats var decls into |
| 5 |
short var decls. |
| 6 |
|
| 7 |
-- settings.json -- |
| 8 |
{ |
| 9 |
"formatting.gofumpt": true |
| 10 |
} |
| 11 |
|
| 12 |
-- main.go -- |
| 13 |
package main //@format(main) |
| 14 |
|
| 15 |
func Match(data []byte) int { |
| 16 |
//line :1 |
| 17 |
var idx = ^uint(0) |
| 18 |
_ = idx |
| 19 |
return -1 |
| 20 |
} |
| 21 |
-- @main -- |
| 22 |
package main //@format(main) |
| 23 |
|
| 24 |
func Match(data []byte) int { |
| 25 |
//line :1 |
| 26 |
idx := ^uint(0) |
| 27 |
_ = idx |
| 28 |
return -1 |
| 29 |
} |