summaryrefslogtreecommitdiff
path: root/libgo/go/cmd/go/testdata/script/mod_bad_domain.txt
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/cmd/go/testdata/script/mod_bad_domain.txt')
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_bad_domain.txt29
1 files changed, 29 insertions, 0 deletions
diff --git a/libgo/go/cmd/go/testdata/script/mod_bad_domain.txt b/libgo/go/cmd/go/testdata/script/mod_bad_domain.txt
new file mode 100644
index 00000000000..c9fd044cdc8
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_bad_domain.txt
@@ -0,0 +1,29 @@
+env GO111MODULE=on
+
+# explicit get should report errors about bad names
+! go get appengine
+stderr 'malformed module path "appengine": missing dot in first path element'
+! go get x/y.z
+stderr 'malformed module path "x/y.z": missing dot in first path element'
+
+# build should report all unsatisfied imports,
+# but should be more definitive about non-module import paths
+! go build ./useappengine
+stderr 'cannot find package'
+! go build ./usenonexistent
+stderr 'cannot find module providing package nonexistent.rsc.io'
+
+# go mod vendor and go mod tidy should ignore appengine imports.
+rm usenonexistent/x.go
+go mod tidy
+go mod vendor
+
+-- go.mod --
+module x
+
+-- useappengine/x.go --
+package useappengine
+import _ "appengine" // package does not exist
+-- usenonexistent/x.go --
+package usenonexistent
+import _ "nonexistent.rsc.io" // domain does not exist