...
1# Test that "go list" succeeds when given a directory in a replacement
2# module within the module cache.
3# Verifies golang.org/issue/29548
4
5# Populate go.sum and download dependencies.
6go get
7
8# Ensure v1.5.2 is also in the cache so we can list it.
9go mod download rsc.io/quote@v1.5.2
10
11! go list $GOPATH/pkg/mod/rsc.io/quote@v1.5.2
12stderr '^directory ..[/\\]pkg[/\\]mod[/\\]rsc.io[/\\]quote@v1.5.2 outside main module or its selected dependencies$'
13
14go list $GOPATH/pkg/mod/rsc.io/quote@v1.5.1
15stdout 'rsc.io/quote'
16
17-- go.mod --
18module example.com/quoter
19
20require rsc.io/quote v1.5.2
21
22replace rsc.io/quote => rsc.io/quote v1.5.1
23
24-- use.go --
25package use
26
27import _ "rsc.io/quote"
View as plain text