1 # GO111MODULE=auto should only trigger outside GOPATH/src
6 ! stdout . # no non-empty lines
7 ! go list -m -f {{.GoMod}}
8 stderr 'not using modules'
10 cd $GOPATH/src/x/y/z/w
21 go list -m -f {{.GoMod}}
24 cd $GOPATH/foo/bar/baz
28 # GO111MODULE=on should trigger everywhere
35 cd $GOPATH/src/x/y/z/w
43 stderr 'cannot find main module'
49 cd $GOPATH/foo/bar/baz
53 # GO111MODULE=off should trigger nowhere
64 cd $GOPATH/foo/bar/baz
68 # GO111MODULE=auto should ignore and warn about /tmp/go.mod
70 cp $GOPATH/src/x/y/z/go.mod $WORK/tmp/go.mod
75 stderr '^go: warning: ignoring go.mod in system temp root '
77 -- $GOPATH/src/x/y/z/go.mod --
79 -- $GOPATH/src/x/y/z/w/w.txt --
80 -- $GOPATH/foo/go.mod --
81 module example.com/mod
82 -- $GOPATH/foo/bar/baz/quux.txt --