mirror of
https://github.com/golang/go
synced 2024-11-18 00:34:44 -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:
parent
871f35980e
commit
4a9b251e37
20
src/cmd/go/testdata/script/mod_dir.txt
vendored
Normal file
20
src/cmd/go/testdata/script/mod_dir.txt
vendored
Normal 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
|
Loading…
Reference in New Issue
Block a user