about toolchain directive in go.mod?

33 views
Skip to first unread message

xie cui

unread,
Jul 24, 2024, 9:25:48 PM (15 hours ago) Jul 24
to golang-nuts
go.mod:
module toolchain_test

go 1.22.3

toolchain go1.25.0

main.go:

package main

func main() {
   println("Hello World!")
}

when run go build, I think that should try to download toolchain 1.25.0 which do not exist. So I expect that cmd should failed. But It run sucess.

王旭东

unread,
2:24 AM (10 hours ago) 2:24 AM
to golang-nuts
Hi,

Please refer to the Go toolchain selection section. go command consults the GOTOOLCHAIN env before making a decision.

Thanks,
Xudong



Reply all
Reply to author
Forward
0 new messages