From e060e588abf40cc29f07dac0a30e9c0a8c71bf5e Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 7 Apr 2022 17:25:55 +0200 Subject: [PATCH] goenv: look for Go version in $GOROOT/src/internal/buildcfg/zbootstrap.go The old path, $GOROOT/runtime/internal/sys/zversion.go, no longer contains the Go version. Signed-off-by: Elias Naur --- goenv/version.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/goenv/version.go b/goenv/version.go index 7142491c..451fbe88 100644 --- a/goenv/version.go +++ b/goenv/version.go @@ -58,9 +58,9 @@ func GorootVersionString(goroot string) (string, error) { return string(data), nil } else if data, err := ioutil.ReadFile(filepath.Join( - goroot, "src", "runtime", "internal", "sys", "zversion.go")); err == nil { + goroot, "src", "internal", "buildcfg", "zbootstrap.go")); err == nil { - r := regexp.MustCompile("const TheVersion = `(.*)`") + r := regexp.MustCompile("const version = `(.*)`") matches := r.FindSubmatch(data) if len(matches) != 2 { return "", errors.New("Invalid go version output:\n" + string(data))