| 1 |
exec gofumpt -w foo.go |
| 2 |
cmp foo.go foo.go.golden |
| 3 |
|
| 4 |
exec gofumpt -d foo.go.golden |
| 5 |
! stdout . |
| 6 |
|
| 7 |
-- foo.go -- |
| 8 |
//go:build tag |
| 9 |
// +build tag |
| 10 |
|
| 11 |
package p |
| 12 |
|
| 13 |
//go:generate some command |
| 14 |
|
| 15 |
//go:unknowndirective |
| 16 |
|
| 17 |
//lint:disablefoo |
| 18 |
|
| 19 |
//go-sumtype:decl Foo |
| 20 |
|
| 21 |
//nolint |
| 22 |
|
| 23 |
//nolint // explanation |
| 24 |
|
| 25 |
//nolint:somelinter // explanation |
| 26 |
|
| 27 |
//NOSONAR |
| 28 |
|
| 29 |
//NOSONAR // explanation |
| 30 |
|
| 31 |
//noinspection ALL |
| 32 |
|
| 33 |
//noinspection foo,bar |
| 34 |
|
| 35 |
//not actually: a directive |
| 36 |
|
| 37 |
//https://just.one/url |
| 38 |
|
| 39 |
//TODO: do something |
| 40 |
|
| 41 |
//export CgoFunc |
| 42 |
|
| 43 |
//extern open |
| 44 |
func c_open(name *byte, mode int, perm int) int |
| 45 |
|
| 46 |
//line 123 |
| 47 |
|
| 48 |
//sys Unlink(path string) (err error) |
| 49 |
|
| 50 |
//sysnb Getpid() (pid int) |
| 51 |
|
| 52 |
//foo is foo. |
| 53 |
type foo int |
| 54 |
|
| 55 |
// comment with a tab. |
| 56 |
|
| 57 |
// comment with many spaces |
| 58 |
|
| 59 |
//comment group |
| 60 |
//123 numbers too |
| 61 |
|
| 62 |
// comment group |
| 63 |
//123 numbers too |
| 64 |
|
| 65 |
//{ |
| 66 |
//this is probably code |
| 67 |
//} |
| 68 |
|
| 69 |
//////////// |
| 70 |
// ascii art |
| 71 |
//---------- |
| 72 |
|
| 73 |
// |
| 74 |
-- foo.go.golden -- |
| 75 |
//go:build tag |
| 76 |
// +build tag |
| 77 |
|
| 78 |
package p |
| 79 |
|
| 80 |
//go:generate some command |
| 81 |
|
| 82 |
//go:unknowndirective |
| 83 |
|
| 84 |
//lint:disablefoo |
| 85 |
|
| 86 |
//go-sumtype:decl Foo |
| 87 |
|
| 88 |
//nolint |
| 89 |
|
| 90 |
//nolint // explanation |
| 91 |
|
| 92 |
//nolint:somelinter // explanation |
| 93 |
|
| 94 |
//NOSONAR |
| 95 |
|
| 96 |
//NOSONAR // explanation |
| 97 |
|
| 98 |
//noinspection ALL |
| 99 |
|
| 100 |
//noinspection foo,bar |
| 101 |
|
| 102 |
// not actually: a directive |
| 103 |
|
| 104 |
// https://just.one/url |
| 105 |
|
| 106 |
// TODO: do something |
| 107 |
|
| 108 |
//export CgoFunc |
| 109 |
|
| 110 |
//extern open |
| 111 |
func c_open(name *byte, mode int, perm int) int |
| 112 |
|
| 113 |
//line 123 |
| 114 |
|
| 115 |
//sys Unlink(path string) (err error) |
| 116 |
|
| 117 |
//sysnb Getpid() (pid int) |
| 118 |
|
| 119 |
// foo is foo. |
| 120 |
type foo int |
| 121 |
|
| 122 |
// comment with a tab. |
| 123 |
|
| 124 |
// comment with many spaces |
| 125 |
|
| 126 |
// comment group |
| 127 |
// 123 numbers too |
| 128 |
|
| 129 |
// comment group |
| 130 |
// 123 numbers too |
| 131 |
|
| 132 |
//{ |
| 133 |
//this is probably code |
| 134 |
//} |
| 135 |
|
| 136 |
//////////// |
| 137 |
// ascii art |
| 138 |
//---------- |
| 139 |
|
| 140 |
// |