From 4013a7f2047f580a855f36c288e140ccc02ff718 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Thu, 7 Sep 2017 14:57:11 +0100 Subject: [PATCH] main: Be explicit if version details cannot be determined If makeVersionString() is unable to generate a version string, display the particular version element as "<>" rather than defaulting to "". Signed-off-by: James O. D. Hunt --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.go b/main.go index 5c3561a6..7f3109b0 100644 --- a/main.go +++ b/main.go @@ -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")