...

Text file src/cmd/go/testdata/script/mod_gomodcache_vendor.txt

Documentation: cmd/go/testdata/script

     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'
     5go mod tidy
     6go mod vendor
     7
     8go build -mod=vendor
     9go version -m example$GOEXE
    10cp stdout version-m.txt
    11
    12env GOMODCACHE=$WORK${/}modcache
    13go build -mod=vendor
    14go version -m example$GOEXE
    15cmp stdout version-m.txt
    16
    17-- go.mod --
    18module example
    19go 1.22
    20require rsc.io/sampler v1.3.0
    21
    22-- main.go --
    23package main
    24
    25import (
    26    "fmt"
    27    "rsc.io/sampler"
    28)
    29
    30func main() {
    31    fmt.Println(sampler.Hello())
    32}

View as plain text