Skip to content

Commit a9cbd67

Browse files
committed
update GitVersion logic for store metadata
1 parent c796505 commit a9cbd67

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

internal/version/version.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,12 @@ func getBuildInfo() *debug.BuildInfo {
8282
}
8383

8484
func getGitVersion(bi *debug.BuildInfo) string {
85-
if bi == nil {
86-
return consts.Unknown
85+
if gitVersion != consts.Unknown && gitVersion != "" {
86+
return gitVersion
8787
}
8888

89-
// TODO: remove this when the issue https://github.com/golang/go/issues/29228 is fixed
90-
if bi.Main.Version == "(devel)" || bi.Main.Version == "" {
91-
return gitVersion
89+
if bi == nil || bi.Main.Version == "" {
90+
return consts.Unknown
9291
}
9392

9493
return bi.Main.Version

0 commit comments

Comments
 (0)