Skip to content

Commit

Permalink
forbid building with go1.20 or newer
Browse files Browse the repository at this point in the history
  • Loading branch information
uprendis committed Feb 24, 2023
1 parent c7f7f6d commit 50cd051
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/opera/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 50cd051

Please sign in to comment.