You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
garble/testdata/script/gotoolchain.txtar

37 lines
912 B
Plaintext

# Test that garble works with transparent upgrades via GOTOOLCHAIN.
# We want to use the real GOPROXY so that we can download the newer
# toolchain, and we use the host's GOMODCACHE so we can reuse it.
setup-go go1.23.7
env GOPROXY=proxy.golang.org
env GOMODCACHE=${HOST_GOMODCACHE}
# Verify that we are using an older version of Go.
exec go version
stdout 'go version go1\.23\.7'
cd mod
# The builds inside the module use the upgraded toolchain.
exec go run .
stderr 'hello from go1\.24\.1'
# Note that garble hides runtime.Version by design, but we know that it requires
# the Go toolchain version to match the exact same version that built garble,
# and that version is most likely newer than GOVERSION_BASE.
exec garble run .
stderr 'hello from unknown'
-- mod/go.mod --
module test
go 1.24.1
-- mod/main.go --
package main
import "runtime"
func main() {
println("hello from", runtime.Version())
}