aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.go
diff options
context:
space:
mode:
authorRon Evans <[email protected]>2019-09-14 13:36:55 +0200
committerAyke <[email protected]>2019-09-14 17:50:16 +0200
commitbc41cc688f288b36fd6919c81d301163f2de9afd (patch)
treeea06f7acadde938e35f03333990fc14683e7368c /main.go
parent7d481c179faa35c9b2d53774a2d13f923cd50591 (diff)
downloadtinygo-bc41cc688f288b36fd6919c81d301163f2de9afd.tar.gz
tinygo-bc41cc688f288b36fd6919c81d301163f2de9afd.zip
main: check the major/minor installed version of Go before tinygo compile, to ensure that it is a supported version.
Signed-off-by: Ron Evans <[email protected]>
Diffstat (limited to 'main.go')
-rw-r--r--main.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.go b/main.go
index c7e162dfc..0865bff5f 100644
--- a/main.go
+++ b/main.go
@@ -89,8 +89,8 @@ func Compile(pkgName, outpath string, spec *TargetSpec, config *BuildConfig, act
if err != nil {
return fmt.Errorf("could not read version from GOROOT (%v): %v", goroot, err)
}
- if major != 1 {
- return fmt.Errorf("expected major version 1, got go%d.%d", major, minor)
+ if major != 1 || (minor != 11 && minor != 12) {
+ return fmt.Errorf("requires go version 1.11 or 1.12, got go%d.%d", major, minor)
}
for i := 1; i <= minor; i++ {
tags = append(tags, fmt.Sprintf("go1.%d", i))