diff options
Diffstat (limited to 'libgo/go/cmd/go/testdata/script/mod_replace_import.txt')
-rw-r--r-- | libgo/go/cmd/go/testdata/script/mod_replace_import.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libgo/go/cmd/go/testdata/script/mod_replace_import.txt b/libgo/go/cmd/go/testdata/script/mod_replace_import.txt index 0da753a1a76..941ef61d355 100644 --- a/libgo/go/cmd/go/testdata/script/mod_replace_import.txt +++ b/libgo/go/cmd/go/testdata/script/mod_replace_import.txt @@ -23,6 +23,13 @@ stdout 'example.com/y v0.0.0-00010101000000-000000000000 => ./y' stdout 'example.com/x/v3 v3.0.0-00010101000000-000000000000 => ./v3' stdout 'example.com/v v1.12.0 => ./v12' +# The go command should print an informative error when the matched +# module does not contain a package. +cd fail +! go list all +stdout 'localhost.fail' +stderr '^can.t load package: m.go:3:8: module w@latest found \(v0.0.0-00010101000000-000000000000, replaced by ../w\), but does not contain package w$' + -- go.mod -- module example.com/m @@ -107,3 +114,16 @@ package v module v.localhost -- v/v.go -- package v + +-- fail/m.go -- +package main + +import _ "w" + +func main() {} + +-- fail/go.mod -- +module localhost.fail + +replace w => ../w + |