| # Auxiliary test for inclusion of otherwise-unused replacements in |
| # vendor/modules.txt for golang.org/issue/33848. |
| # We need metadata about replacements in order to verify that modules.txt |
| # remains in sync with the main module's go.mod file. |
| |
| env GO111MODULE=on |
| |
| go mod vendor |
| cmp go1.14-modules.txt vendor/modules.txt |
| |
| -- go.mod -- |
| module example.com/foo |
| go 1.14 |
| |
| require ( |
| example.com/a v0.1.0 |
| ) |
| |
| replace ( |
| example.com/a v0.1.0 => ./a |
| example.com/b v0.1.0 => ./b1 |
| example.com/b v0.2.0-unused => ./b2 |
| example.com/c => ./c |
| example.com/d v0.1.0 => ./d1 |
| example.com/d v0.2.0 => ./d2 |
| example.com/e => example.com/e v0.1.0-unused |
| ) |
| -- foo.go -- |
| package foo |
| import _ "example.com/a" |
| -- a/go.mod -- |
| module example.com/a |
| require ( |
| example.com/b v0.1.0 // indirect |
| example.com/c v0.1.0 // indirect |
| ) |
| -- a/a.go -- |
| package a |
| import _ "example.com/d" |
| -- b1/go.mod -- |
| module example.com/b |
| require example.com/d v0.1.0 |
| -- b2/go.mod -- |
| module example.com/b |
| require example.com/c v0.2.0 |
| -- c/go.mod -- |
| module example.com/c |
| require example.com/d v0.2.0 |
| -- d1/go.mod -- |
| module example.com/d |
| -- d1/d1.go -- |
| package d |
| -- d2/go.mod -- |
| module example.com/d |
| -- d2/d2.go -- |
| package d |
| -- go1.14-modules.txt -- |
| # example.com/a v0.1.0 => ./a |
| ## explicit |
| example.com/a |
| # example.com/d v0.2.0 => ./d2 |
| example.com/d |
| # example.com/b v0.1.0 => ./b1 |
| # example.com/b v0.2.0-unused => ./b2 |
| # example.com/c => ./c |
| # example.com/d v0.1.0 => ./d1 |
| # example.com/e => example.com/e v0.1.0-unused |