...
1env GO111MODULE=on
2
3# After 'go get', the go.sum file should contain the sum for the module.
4go get rsc.io/quote@v1.5.0
5grep 'rsc.io/quote v1.5.0' go.sum
6
7# If we replace the module and run 'go mod tidy', we should get a sum for the replacement.
8go mod edit -replace rsc.io/quote@v1.5.0=rsc.io/quote@v1.5.1
9go mod tidy
10grep 'rsc.io/quote v1.5.1' go.sum
11cp go.sum go.sum.tidy
12
13# 'go mod vendor' should preserve that sum, and should not need to add any new entries.
14go mod vendor
15grep 'rsc.io/quote v1.5.1' go.sum
16cmp go.sum go.sum.tidy
17
18-- go.mod --
19module golang.org/issue/27868
20
21require rsc.io/quote v1.5.0
22
23-- main.go --
24package main
25
26import _ "rsc.io/quote"
27
28func main() {}
View as plain text