Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
main: Be explicit if version details cannot be determined
Browse files Browse the repository at this point in the history
If makeVersionString() is unable to generate a version string, display the
particular version element as "<<unknown>>" rather than defaulting to "".

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Sep 7, 2017
1 parent 31d915d commit 4013a7f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,20 @@ func makeVersionString() string {

if version != "" {
v = append(v, name+" : "+version)
} else {
v = append(v, name+" : "+unknown)
}

if commit != "" {
v = append(v, " commit : "+commit)
} else {
v = append(v, " commit : "+unknown)
}

if specs.Version != "" {
v = append(v, " OCI specs: "+specs.Version)
} else {
v = append(v, " OCI specs: "+unknown)
}

return strings.Join(v, "\n")
Expand Down

0 comments on commit 4013a7f

Please sign in to comment.