| 1 |
This test basic gopls functionality in a workspace with a godebug |
| 2 |
directive in its modfile. |
| 3 |
|
| 4 |
We use panicnil from go1.21 as an arbitrary GODEBUG; if it goes away, |
| 5 |
pick another from https://go.dev/doc/godebug#history. |
| 6 |
|
| 7 |
-- flags -- |
| 8 |
-min_go_command=go1.23 |
| 9 |
|
| 10 |
-- a/go.work -- |
| 11 |
go 1.23 |
| 12 |
|
| 13 |
use . |
| 14 |
|
| 15 |
godebug ( |
| 16 |
panicnil=0 |
| 17 |
) |
| 18 |
godebug panicnil=1 |
| 19 |
|
| 20 |
-- a/go.mod -- |
| 21 |
module example.com/a |
| 22 |
|
| 23 |
go 1.23 |
| 24 |
|
| 25 |
-- a/a.go -- |
| 26 |
package a |
| 27 |
|
| 28 |
import "example.com/a/b" |
| 29 |
|
| 30 |
const A = b.B //@def("B", B) |
| 31 |
|
| 32 |
-- a/b/b.go -- |
| 33 |
package b |
| 34 |
|
| 35 |
const B = 42 //@loc(B, "B") |
| 36 |
|
| 37 |
-- format/go.work -- |
| 38 |
go 1.23 //@format(formatted) |
| 39 |
|
| 40 |
use . |
| 41 |
|
| 42 |
godebug ( |
| 43 |
panicnil=0 |
| 44 |
) |
| 45 |
godebug panicnil=1 |
| 46 |
|
| 47 |
-- @formatted -- |
| 48 |
go 1.23 //@format(formatted) |
| 49 |
|
| 50 |
use . |
| 51 |
|
| 52 |
godebug ( |
| 53 |
panicnil=0 |
| 54 |
) |
| 55 |
|
| 56 |
godebug panicnil=1 |
| 57 |
-- format/go.mod -- |
| 58 |
module example.com/format |
| 59 |
|
| 60 |
go 1.23 |
| 61 |
|
| 62 |
-- format/p.go -- |
| 63 |
package format |