blob: dea76f4d4bf595f8dabfd0071bdeafaceb13dfe8 [file] [log] [blame]
env GO111MODULE=on
# Regression test for golang.org/issue/31031:
# Importing or loading a non-existent package in cmd/ should print
# a clear error in module mode.
! go list cmd/unknown
stderr '^package cmd/unknown is not in GOROOT \('$GOROOT'[/\\]src[/\\]cmd[/\\]unknown\)$'
go list -f '{{range .DepsErrors}}{{.Err}}{{end}}' x.go
stdout '^package cmd/unknown is not in GOROOT \('$GOROOT'[/\\]src[/\\]cmd[/\\]unknown\)$'
-- x.go --
package x
import _ "cmd/unknown"