github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/script/mod_dot.txt (about) 1 env GO111MODULE=on 2 3 # golang.org/issue/32917 and golang.org/issue/28459: 'go build' and 'go test' 4 # in an empty directory should refer to the path '.' and should not attempt 5 # to resolve an external module. 6 cd dir 7 ! go get . 8 stderr 'go get \.: path .* is not a package in module rooted at .*[/\\]dir$' 9 ! go list 10 ! stderr 'cannot find module providing package' 11 stderr '^can.t load package: package \.: no Go files in '$WORK'[/\\]gopath[/\\]src[/\\]dir$' 12 13 cd subdir 14 ! go list 15 ! stderr 'cannot find module providing package' 16 stderr '^can.t load package: package \.: no Go files in '$WORK'[/\\]gopath[/\\]src[/\\]dir[/\\]subdir$' 17 cd .. 18 19 # golang.org/issue/30590: if a package is found in the filesystem 20 # but is not in the main module, the error message should not say 21 # "cannot find module providing package", and we shouldn't try 22 # to find a module providing the package. 23 ! go list ./othermodule 24 ! stderr 'cannot find module providing package' 25 stderr 'go: directory othermodule is outside main module' 26 27 -- dir/go.mod -- 28 module example.com 29 go 1.13 30 -- dir/subdir/README -- 31 There are no Go source files in this directory. 32 -- dir/othermodule/go.mod -- 33 module example.com/othermodule 34 go 1.13 35 -- dir/othermodule/om.go -- 36 package othermodule