...
1# When 'go get' is invoked on a module without a package in the root directory,
2# it should add sums for the module's go.mod file and its content to go.sum.
3# Verifies golang.org/issue/41103.
4go mod init m
5go get rsc.io/QUOTE
6grep '^rsc.io/QUOTE v1.5.2/go.mod ' go.sum
7grep '^rsc.io/QUOTE v1.5.2 ' go.sum
8
9# Double-check rsc.io/QUOTE does not have a root package.
10! go list -mod=readonly rsc.io/QUOTE
11stderr '^cannot find module providing package rsc.io/QUOTE: import lookup disabled by -mod=readonly$'
View as plain text