From 2259427edf75c5f9e591b0b255975a5d60bb5ce6 Mon Sep 17 00:00:00 2001 From: Ram Lavi Date: Sun, 3 May 2026 09:06:59 +0300 Subject: [PATCH] fix(hack): prefer go toolchain version in go-version.sh When a `toolchain` directive is present in go.mod, use its version instead of the `go` directive. This ensures that install-go.sh downloads the correct patch-level Go binary and that Makefile's GO_VERSION reflects the intended toolchain. Assisted-by: Claude Opus 4.6 Signed-off-by: Ram Lavi --- hack/go-version.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hack/go-version.sh b/hack/go-version.sh index f50917c61a..8127a2f1ae 100755 --- a/hack/go-version.sh +++ b/hack/go-version.sh @@ -1,2 +1,7 @@ #!/bin/bash -e -grep ^go go.mod | awk '{print $2}' +toolchain=$(grep '^toolchain' go.mod | awk '{print $2}' | sed 's/^go//') +if [ -n "$toolchain" ]; then + echo "$toolchain" +else + grep '^go' go.mod | awk '{print $2}' +fi