1
0
mirror of https://github.com/golang/go synced 2024-11-18 00:44:47 -07:00

cmd: ignore the directory named go.mod

The existing implementation does not check in all cases whether go.mod is a regular file.

Fixes #30788
This commit is contained in:
Leonardo Comelli 2019-03-19 00:51:36 -03:00
parent 871f35980e
commit 4a9b251e37

20
src/cmd/go/testdata/script/mod_dir.txt vendored Normal file
View File

@ -0,0 +1,20 @@
# The directory named go.mod should be ignored
env GO111MODULE=on
cd $WORK/sub
go list .
stdout 'x/sub'
mkdir go.mod
exists go.mod
go list .
stdout 'x/sub'
-- $WORK/go.mod --
module x
-- $WORK/sub/x.go --
package x