diff options
author | Elias Naur <[email protected]> | 2022-04-07 17:25:55 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-04-09 10:11:07 +0200 |
commit | e060e588abf40cc29f07dac0a30e9c0a8c71bf5e (patch) | |
tree | 46a8a6e9aba5e89873d3edd1d3aab7b7233e73c9 /goenv/version.go | |
parent | 8dfb317d280e4c9cce4021cd16fa772d0699c590 (diff) | |
download | tinygo-e060e588abf40cc29f07dac0a30e9c0a8c71bf5e.tar.gz tinygo-e060e588abf40cc29f07dac0a30e9c0a8c71bf5e.zip |
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 <[email protected]>
Diffstat (limited to 'goenv/version.go')
-rw-r--r-- | goenv/version.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/goenv/version.go b/goenv/version.go index 7142491c3..451fbe882 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)) |