fix: Prefix buildinfo tag with "v" (#1256)

This fixes the format of production and development build
tags.
This commit is contained in:
Kyle Carberry
2022-05-02 15:58:36 +00:00
committed by GitHub
parent d139a16446
commit 252d868298
+7 -3
View File
@@ -33,13 +33,17 @@ func Version() string {
revision = "+" + revision[:7]
}
if tag == "" {
// This occurs when the tag hasn't been injected,
// like when using "go run".
version = "v0.0.0-devel" + revision
return
}
if semver.Build(tag) == "" {
tag += revision
}
version = "v" + tag
// The tag must be prefixed with "v" otherwise the
// semver library will return an empty string.
if semver.Build(version) == "" {
version += revision
}
})
return version
}