We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cdbd99b commit 8ed1935Copy full SHA for 8ed1935
build/code-batch-process.go
@@ -13,7 +13,6 @@ import (
13
"os/exec"
14
"path/filepath"
15
"regexp"
16
- "runtime/debug"
17
"strconv"
18
"strings"
19
@@ -210,12 +209,8 @@ Example:
210
209
func getGoVersion() string {
211
goModFile, err := os.ReadFile("go.mod")
212
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")
+ log.Fatalf(`Faild to read "go.mod": %v`, err)
+ os.Exit(1)
219
}
220
goModVersionRegex := regexp.MustCompile(`go \d+\.\d+`)
221
goModVersionLine := goModVersionRegex.Find(goModFile)
0 commit comments