Skip to content

Commit

Permalink
Remove fallback to build info
Browse files Browse the repository at this point in the history
Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
  • Loading branch information
yardenshoham committed Oct 15, 2022
1 parent cdbd99b commit 8ed1935
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions build/code-batch-process.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"os/exec"
"path/filepath"
"regexp"
"runtime/debug"
"strconv"
"strings"

Expand Down Expand Up @@ -210,12 +209,8 @@ Example:
func getGoVersion() string {
goModFile, err := os.ReadFile("go.mod")
if err != nil {
buildInfo, ok := debug.ReadBuildInfo()
if !ok {
log.Fatalf("Failed to read build info")
os.Exit(1)
}
return strings.TrimPrefix(buildInfo.GoVersion, "go")
log.Fatalf(`Faild to read "go.mod": %v`, err)
os.Exit(1)
}
goModVersionRegex := regexp.MustCompile(`go \d+\.\d+`)
goModVersionLine := goModVersionRegex.Find(goModFile)
Expand Down

0 comments on commit 8ed1935

Please sign in to comment.