cmd/utils/flags.go: Applying a String len guard for the gitCommit param of the NewApp()

This commit is contained in:
Evangelos Pappas 2018-01-02 09:32:03 +00:00
parent 908faf8cd7
commit 89be5f76f8
No known key found for this signature in database
GPG key ID: F6FEDFFE62C87FC6

View file

@ -96,7 +96,7 @@ func NewApp(gitCommit, usage string) *cli.App {
//app.Authors = nil
app.Email = ""
app.Version = params.Version
if gitCommit != "" {
if gitCommit != "" && len(gitCommit) >= 8 {
app.Version += "-" + gitCommit[:8]
}
app.Usage = usage