diff --git a/cmd/opera/main.go b/cmd/opera/main.go index 5c29d1501..76dd899ed 100644 --- a/cmd/opera/main.go +++ b/cmd/opera/main.go @@ -3,11 +3,22 @@ package main import ( "fmt" "os" + "runtime" "github.com/Fantom-foundation/go-opera/cmd/opera/launcher" ) func main() { + // TODO erase after compatibility issues with go1.20 are fixed + var majorVer int + var minorVer int + var other string + n, err := fmt.Sscanf(runtime.Version(), "go%d.%d%s", &majorVer, &minorVer, &other) + if n >= 2 && err == nil { + if (majorVer*100 + minorVer) > 119 { + panic(runtime.Version() + " is not supported, please downgrade your go compiler to go 1.19 or older") + } + } if err := launcher.Launch(os.Args); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1)