Skip to content

Commit 3784ffe

Browse files
ccojocarCosmin Cojocar
authored and
Cosmin Cojocar
committed
Fix panic when reading the version from debug info in Go 1.13
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
1 parent 55d368f commit 3784ffe

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

cmd/gosec/version.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package main
22

3-
import (
4-
"runtime/debug"
5-
)
6-
73
// Version is the build version
84
var Version string
95

@@ -19,7 +15,10 @@ var BuildDate string
1915
// https://github.com/golang/go/issues/29814 gets resolved.
2016
func prepareVersionInfo() {
2117
if Version == "" {
22-
bi, _ := debug.ReadBuildInfo()
23-
Version = bi.Main.Version
18+
// bi, _ := debug.ReadBuildInfo()
19+
// Version = bi.Main.Version
20+
// TODO use the debug information when it will provide more details
21+
// It seems to panic with Go 1.13.
22+
Version = "dev"
2423
}
2524
}

0 commit comments

Comments
 (0)