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

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

View as plain text