From 3f3af841afe5637996b45272e3460a8f095fb151 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 16 Feb 2026 01:05:32 +0000 Subject: [PATCH] tool/gocross: respect TS_GO_NEXT=1 in gocross too The gocross-wrapper.sh bash script already checks TS_GO_NEXT (as of a374cc344e48) to select go.toolchain.next.rev over go.toolchain.rev, but when TS_USE_GOCROSS=1 the Go binary itself was hardcoded to read go.toolchain.rev. This makes gocross also respect the TS_GO_NEXT=1 environment variable. Updates tailscale/corp#36382 Change-Id: I04bef25a34e7ed3ccb1bfdb33a3a1f896236c6ee Signed-off-by: Brad Fitzpatrick --- tool/gocross/toolchain.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tool/gocross/toolchain.go b/tool/gocross/toolchain.go index 2eb675861..8086d9697 100644 --- a/tool/gocross/toolchain.go +++ b/tool/gocross/toolchain.go @@ -43,7 +43,11 @@ findTopLevel: } } - return readRevFile(filepath.Join(d, "go.toolchain.rev")) + revFile := "go.toolchain.rev" + if os.Getenv("TS_GO_NEXT") == "1" { + revFile = "go.toolchain.next.rev" + } + return readRevFile(filepath.Join(d, revFile)) } func readRevFile(path string) (string, error) {