...

Text file src/cmd/go/testdata/script/env_unset.txt

Documentation: cmd/go/testdata/script

     1# Test that we can unset variables, even if initially invalid,
     2# as long as resulting config is valid.
     3
     4env GOENV=badenv
     5env GOOS=
     6env GOARCH=
     7env GOEXPERIMENT=
     8
     9! go env
    10stderr '^go(\.exe)?: unknown GOEXPERIMENT badexp$'
    11
    12go env -u GOEXPERIMENT
    13
    14! go env
    15stderr '^go: unsupported GOOS/GOARCH pair bados/badarch$'
    16
    17! go env -u GOOS
    18stderr '^go: unsupported GOOS/GOARCH pair \w+/badarch$'
    19
    20! go env -u GOARCH
    21stderr '^go: unsupported GOOS/GOARCH pair bados/\w+$'
    22
    23go env -u GOOS GOARCH
    24
    25go env
    26
    27-- badenv --
    28GOOS=bados
    29GOARCH=badarch
    30GOEXPERIMENT=badexp

View as plain text