1 env GO111MODULE=on
2
3 # Regression test for golang.org/issue/31031:
4 # Importing or loading a non-existent package in cmd/ should print
5 # a clear error in module mode.
6
7 ! go list cmd/unknown
8 stderr '^package cmd/unknown is not in GOROOT \('$GOROOT'[/\\]src[/\\]cmd[/\\]unknown\)$'
9
10 go list -f '{{range .DepsErrors}}{{.Err}}{{end}}' x.go
11 stdout '^package cmd/unknown is not in GOROOT \('$GOROOT'[/\\]src[/\\]cmd[/\\]unknown\)$'
12
13 -- x.go --
14 package x
15
16 import _ "cmd/unknown"
17
View as plain text