Add build info if run with debug
This commit is contained in:
parent
fad8502639
commit
80d7f9fb52
6
main.go
6
main.go
@ -8,6 +8,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime/debug"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -98,6 +99,11 @@ func main() {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if buildInfo, ok := debug.ReadBuildInfo(); ok {
|
||||||
|
log.Debug().Msgf("%v", buildInfo.GoVersion)
|
||||||
|
log.Debug().Msgf("%v", buildInfo.Settings)
|
||||||
|
}
|
||||||
|
|
||||||
err := ctx.Run(&cli.Globals)
|
err := ctx.Run(&cli.Globals)
|
||||||
ctx.FatalIfErrorf(err)
|
ctx.FatalIfErrorf(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user