diff options
| author | Russ Cox <rsc@golang.org> | 2023-03-14 14:25:56 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2023-04-18 13:19:19 +0000 |
| commit | 14ab998f95b53baa6e336c598b0f34e319cc9717 (patch) | |
| tree | 153dfe7575c56668f0668441442cf0a581269778 /src/internal/godebug/godebug_test.go | |
| parent | 44e51e60acb8a1ff6ba10d698615fde98b2b28b0 (diff) | |
| download | go-14ab998f95b53baa6e336c598b0f34e319cc9717.tar.xz | |
cmd/go: add check for unknown godebug setting
A //go:debug line mentioning an unknown or retired setting
should be diagnosed as making the program invalid. Do that.
We agreed on this in the proposal but I forgot to implement it.
Change-Id: Ie69072a1682d4eeb6866c02adbbb426f608567c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/476280
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/internal/godebug/godebug_test.go')
| -rw-r--r-- | src/internal/godebug/godebug_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/internal/godebug/godebug_test.go b/src/internal/godebug/godebug_test.go index 2f311106b1..ad5ced3558 100644 --- a/src/internal/godebug/godebug_test.go +++ b/src/internal/godebug/godebug_test.go @@ -11,13 +11,13 @@ import ( ) func TestGet(t *testing.T) { - foo := New("foo") + foo := New("#foo") tests := []struct { godebug string setting *Setting want string }{ - {"", New(""), ""}, + {"", New("#"), ""}, {"", foo, ""}, {"foo=bar", foo, "bar"}, {"foo=bar,after=x", foo, "bar"}, @@ -28,7 +28,7 @@ func TestGet(t *testing.T) { {"foo=", foo, ""}, {"foo", foo, ""}, {",foo", foo, ""}, - {"foo=bar,baz", New("loooooooong"), ""}, + {"foo=bar,baz", New("#loooooooong"), ""}, } for _, tt := range tests { t.Setenv("GODEBUG", tt.godebug) |
