mirror of
https://github.com/securego/gosec.git
synced 2025-11-29 22:37:59 +02:00
Fix panic when reading the version from debug info in Go 1.13
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
This commit is contained in:
committed by
Cosmin Cojocar
parent
55d368f2e5
commit
3784ffea4e
@@ -1,9 +1,5 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"runtime/debug"
|
||||
)
|
||||
|
||||
// Version is the build version
|
||||
var Version string
|
||||
|
||||
@@ -19,7 +15,10 @@ var BuildDate string
|
||||
// https://github.com/golang/go/issues/29814 gets resolved.
|
||||
func prepareVersionInfo() {
|
||||
if Version == "" {
|
||||
bi, _ := debug.ReadBuildInfo()
|
||||
Version = bi.Main.Version
|
||||
// bi, _ := debug.ReadBuildInfo()
|
||||
// Version = bi.Main.Version
|
||||
// TODO use the debug information when it will provide more details
|
||||
// It seems to panic with Go 1.13.
|
||||
Version = "dev"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user