Skip to content

Commit bc41cc6

Browse files
deadprogramaykevl
authored andcommitted
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]>
1 parent 7d481c1 commit bc41cc6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ func Compile(pkgName, outpath string, spec *TargetSpec, config *BuildConfig, act
8989
if err != nil {
9090
return fmt.Errorf("could not read version from GOROOT (%v): %v", goroot, err)
9191
}
92-
if major != 1 {
93-
return fmt.Errorf("expected major version 1, got go%d.%d", major, minor)
92+
if major != 1 || (minor != 11 && minor != 12) {
93+
return fmt.Errorf("requires go version 1.11 or 1.12, got go%d.%d", major, minor)
9494
}
9595
for i := 1; i <= minor; i++ {
9696
tags = append(tags, fmt.Sprintf("go1.%d", i))

0 commit comments

Comments
 (0)