diff options
author | Ron Evans <[email protected]> | 2019-09-14 13:36:55 +0200 |
---|---|---|
committer | Ayke <[email protected]> | 2019-09-14 17:50:16 +0200 |
commit | bc41cc688f288b36fd6919c81d301163f2de9afd (patch) | |
tree | ea06f7acadde938e35f03333990fc14683e7368c /main.go | |
parent | 7d481c179faa35c9b2d53774a2d13f923cd50591 (diff) | |
download | tinygo-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.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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)) |