]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: add a regression test for #45979
authorBryan C. Mills <bcmills@google.com>
Fri, 11 Jun 2021 20:39:54 +0000 (16:39 -0400)
committerBryan C. Mills <bcmills@google.com>
Wed, 16 Jun 2021 20:37:49 +0000 (20:37 +0000)
Change-Id: Id7f83b2e6a99af798e55b272b04880ebb588351f
Reviewed-on: https://go-review.googlesource.com/c/go/+/328230
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/cmd/go/testdata/script/mod_get_lazy_indirect.txt [new file with mode: 0644]

diff --git a/src/cmd/go/testdata/script/mod_get_lazy_indirect.txt b/src/cmd/go/testdata/script/mod_get_lazy_indirect.txt
new file mode 100644 (file)
index 0000000..60548e8
--- /dev/null
@@ -0,0 +1,38 @@
+# https://golang.org/issue/45979: after 'go get' on a package,
+# that package should be importable without error.
+
+
+# We start out with an unresolved dependency.
+# 'go list' suggests that we run 'go get' on that dependency.
+
+! go list -deps .
+stderr '^m.go:3:8: no required module provides package rsc\.io/quote; to add it:\n\tgo get rsc.io/quote$'
+
+
+# Unfortunately, the suggested 'go get' command leaves us with another problem.
+#
+# TODO(#45979): After 'go get', the 'go list' command from above should succeed.
+
+go get rsc.io/quote
+
+! go list -deps .
+stderr '^go: updates to go.mod needed; to update it:\n\tgo mod tidy'
+[!short] ! go build .
+stderr '^go: updates to go.mod needed; to update it:\n\tgo mod tidy'
+
+
+# After running the suggested 'go mod tidy' command, the build
+# should succeed.
+go mod tidy
+go list -deps .
+[!short] go build .
+
+
+-- go.mod --
+module example.com/m
+
+go 1.17
+-- m.go --
+package m
+
+import _ "rsc.io/quote"