Skip to content

Commit f3c174b

Browse files
committed
fix: Prefix buildinfo tag with "v"
This fixes the format of production and development build tags.
1 parent a71f393 commit f3c174b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

buildinfo/buildinfo.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@ func Version() string {
3333
revision = "+" + revision[:7]
3434
}
3535
if tag == "" {
36+
// This occurs when the tag hasn't been injected,
37+
// like when using "go run".
3638
version = "v0.0.0-devel" + revision
3739
return
3840
}
39-
if semver.Build(tag) == "" {
41+
// The tag must be prefixed with "v" otherwise the
42+
// semver library will return an empty string.
43+
if semver.Build("v"+tag) == "" {
4044
tag += revision
4145
}
4246
version = "v" + tag

0 commit comments

Comments
 (0)