...
1# This test checks error messages for non-existent packages in module mode.
2# Veries golang.org/issue/35414
3env GO111MODULE=on
4cd $WORK
5
6go list -e -f {{.Error}} .
7stdout 'no Go files in '$WORK
8
9go list -e -f {{.Error}} ./empty
10stdout 'no Go files in '$WORK${/}'empty'
11
12go list -e -f {{.Error}} ./exclude
13stdout 'build constraints exclude all Go files in '$WORK${/}'exclude'
14
15go list -e -f {{.Error}} ./missing
16stdout 'stat '$WORK'[/\\]missing: directory not found'
17
18# use 'go build -n' because 'go list' reports no error.
19! go build -n ./testonly
20stderr 'example.com/m/testonly: no non-test Go files in '$WORK${/}'testonly'
21
22-- $WORK/go.mod --
23module example.com/m
24
25go 1.14
26
27-- $WORK/empty/empty.txt --
28-- $WORK/exclude/exclude.go --
29// +build exclude
30
31package exclude
32-- $WORK/testonly/testonly_test.go --
33package testonly_test
34-- $WORK/excluded-stdout --
35package ./excluded: cannot find package "." in:
36 $WORK/excluded
View as plain text