builder: move Go version code to goenv package

This is necessary to avoid a circular dependency in the loader (which
soon will need to read the Go version) and because it seems like a
better place anyway.
This commit is contained in:
Ayke van Laethem
2020-05-04 16:18:24 +02:00
committed by Ron Evans
parent 4918395f88
commit 2a98433c8e
5 changed files with 67 additions and 61 deletions
+1 -1
View File
@@ -897,7 +897,7 @@ func main() {
usage()
case "version":
goversion := "<unknown>"
if s, err := builder.GorootVersionString(goenv.Get("GOROOT")); err == nil {
if s, err := goenv.GorootVersionString(goenv.Get("GOROOT")); err == nil {
goversion = s
}
fmt.Printf("tinygo version %s %s/%s (using go version %s and LLVM version %s)\n", version, runtime.GOOS, runtime.GOARCH, goversion, llvm.Version)