Skip to content

Commit 8ed1935

Browse files
committed
Remove fallback to build info
Signed-off-by: Yarden Shoham <[email protected]>
1 parent cdbd99b commit 8ed1935

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

build/code-batch-process.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"os/exec"
1414
"path/filepath"
1515
"regexp"
16-
"runtime/debug"
1716
"strconv"
1817
"strings"
1918

@@ -210,12 +209,8 @@ Example:
210209
func getGoVersion() string {
211210
goModFile, err := os.ReadFile("go.mod")
212211
if err != nil {
213-
buildInfo, ok := debug.ReadBuildInfo()
214-
if !ok {
215-
log.Fatalf("Failed to read build info")
216-
os.Exit(1)
217-
}
218-
return strings.TrimPrefix(buildInfo.GoVersion, "go")
212+
log.Fatalf(`Faild to read "go.mod": %v`, err)
213+
os.Exit(1)
219214
}
220215
goModVersionRegex := regexp.MustCompile(`go \d+\.\d+`)
221216
goModVersionLine := goModVersionRegex.Find(goModFile)

0 commit comments

Comments
 (0)