# https://golang.org/issue/41297: 'go list -m' should not require go.sum with # -versions or when all args are version queries. go mod init m go mod edit -require=rsc.io/quote@v1.5.1 go list -m -mod=readonly rsc.io/quote@latest stdout '^rsc\.io/quote v1\.5\.2$' ! stderr . go list -m -mod=readonly -versions rsc.io/quote stdout 'rsc\.io/quote v1\.0\.0 .* v1\.5\.3-pre1$' ! stderr . # Incidentally fetching the required version of a module records its checksum, # just because it happens to be in the build list, and recording the checksum # triggers an error under -mod=readonly. # # TODO(#41297): This should not be an error. ! go list -m -mod=readonly rsc.io/quote@