1 # When we attempt to resolve an import that doesn't exist, we should not save
2 # hashes for downloaded modules.
3 # Verifies golang.org/issue/36260.
4 # TODO(golang.org/issue/26603): use 'go mod tidy -e' when implemented.
5 go list -e -mod=mod -tags=ignore ./noexist
6 ! exists go.sum
7
8 # When an import is resolved successfully, we should only save hashes for
9 # the module that provides the package, not for other modules looked up.
10 # Verifies golang.org/issue/31580.
11 go get ./exist
12 grep '^example.com/join v1.1.0 h1:' go.sum
13 ! grep '^example.com/join/subpkg' go.sum
14 cp go.sum go.list.sum
15 go mod tidy
16 cmp go.sum go.list.sum
17
18 -- go.mod --
19 module m
20
21 go 1.15
22
23 -- noexist/use.go --
24 // ignore tags prevents errors in 'go mod tidy'
25 // +build ignore
26
27 package use
28
29 import _ "example.com/join/subpkg/noexist"
30
31 -- exist/use.go --
32 package use
33
34 import _ "example.com/join/subpkg"
35
View as plain text