| 1 |
# Whether we run gofumpt from inside or outside a module, |
| 2 |
# we should always use the information from its go.mod. |
| 3 |
# We also test that we don't get confused by the presence of go.work. |
| 4 |
|
| 5 |
exec gofumpt a/go112.go |
| 6 |
cmp stdout a/go113.go |
| 7 |
|
| 8 |
cd a |
| 9 |
exec gofumpt go112.go |
| 10 |
cmp stdout go113.go |
| 11 |
|
| 12 |
-- go.work -- |
| 13 |
go 1.18 |
| 14 |
use ./a |
| 15 |
use ./b |
| 16 |
-- a/go.mod -- |
| 17 |
module a |
| 18 |
go 1.18 |
| 19 |
-- a/a.go -- |
| 20 |
package a |
| 21 |
-- a/go112.go -- |
| 22 |
package main |
| 23 |
|
| 24 |
const x = 0777 |
| 25 |
-- a/go113.go -- |
| 26 |
package main |
| 27 |
|
| 28 |
const x = 0o777 |
| 29 |
-- b/go.mod -- |
| 30 |
module b |
| 31 |
go 1.18 |
| 32 |
-- b/b.go -- |
| 33 |
package b |