diff options
Diffstat (limited to 'libgo/go/cmd/go/testdata/script/mod_empty_err.txt')
-rw-r--r-- | libgo/go/cmd/go/testdata/script/mod_empty_err.txt | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/libgo/go/cmd/go/testdata/script/mod_empty_err.txt b/libgo/go/cmd/go/testdata/script/mod_empty_err.txt new file mode 100644 index 00000000000..729f848156d --- /dev/null +++ b/libgo/go/cmd/go/testdata/script/mod_empty_err.txt @@ -0,0 +1,36 @@ +# This test checks error messages for non-existant packages in module mode. +# Veries golang.org/issue/35414 +env GO111MODULE=on +cd $WORK + +go list -e -f {{.Error}} . +stdout 'package \.: no Go files in \$WORK' + +go list -e -f {{.Error}} ./empty +stdout 'package \./empty: no Go files in \$WORK[/\\]empty' + +go list -e -f {{.Error}} ./exclude +stdout 'package \./exclude: build constraints exclude all Go files in \$WORK[/\\]exclude' + +go list -e -f {{.Error}} ./missing +stdout 'package \./missing: cannot find package "." in:\s*\$WORK[/\\]missing' + +# use 'go build -n' because 'go list' reports no error. +! go build -n ./testonly +stderr 'example.com/m/testonly: no non-test Go files in \$WORK[/\\]testonly' + +-- $WORK/go.mod -- +module example.com/m + +go 1.14 + +-- $WORK/empty/empty.txt -- +-- $WORK/exclude/exclude.go -- +// +build exclude + +package exclude +-- $WORK/testonly/testonly_test.go -- +package testonly_test +-- $WORK/excluded-stdout -- +package ./excluded: cannot find package "." in: + $WORK/excluded |