| 1 |
# This test verifies that GOMODCACHE does not affect whether checksums are embedded |
| 2 |
# with vendored files. |
| 3 |
# See issue #46400 |
| 4 |
[short] skip 'builds and links a binary twice' |
| 5 |
go mod tidy |
| 6 |
go mod vendor |
| 7 |
|
| 8 |
go build -mod=vendor |
| 9 |
go version -m example$GOEXE |
| 10 |
cp stdout version-m.txt |
| 11 |
|
| 12 |
env GOMODCACHE=$WORK${/}modcache |
| 13 |
go build -mod=vendor |
| 14 |
go version -m example$GOEXE |
| 15 |
cmp stdout version-m.txt |
| 16 |
|
| 17 |
-- go.mod -- |
| 18 |
module example |
| 19 |
go 1.22 |
| 20 |
require rsc.io/sampler v1.3.0 |
| 21 |
|
| 22 |
-- main.go -- |
| 23 |
package main |
| 24 |
|
| 25 |
import ( |
| 26 |
"fmt" |
| 27 |
"rsc.io/sampler" |
| 28 |
) |
| 29 |
|
| 30 |
func main() { |
| 31 |
fmt.Println(sampler.Hello()) |
| 32 |
} |