mirror of
https://github.com/securego/gosec.git
synced 2024-11-05 19:45:51 +00: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:
parent
55d368f2e5
commit
3784ffea4e
1 changed files with 5 additions and 6 deletions
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue