| 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. |
| 6 |
go get |
| 7 |
|
| 8 |
# Ensure v1.5.2 is also in the cache so we can list it. |
| 9 |
go mod download rsc.io/[email protected] |
| 10 |
|
| 11 |
! go list $GOPATH/pkg/mod/rsc.io/[email protected] |
| 12 |
stderr '^directory ..[/\\]pkg[/\\]mod[/\\]rsc.io[/\\][email protected] outside main module or its selected dependencies$' |
| 13 |
|
| 14 |
go list $GOPATH/pkg/mod/rsc.io/[email protected] |
| 15 |
stdout 'rsc.io/quote' |
| 16 |
|
| 17 |
-- go.mod -- |
| 18 |
module example.com/quoter |
| 19 |
|
| 20 |
require rsc.io/quote v1.5.2 |
| 21 |
|
| 22 |
replace rsc.io/quote => rsc.io/quote v1.5.1 |
| 23 |
|
| 24 |
-- use.go -- |
| 25 |
package use |
| 26 |
|
| 27 |
import _ "rsc.io/quote" |