We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e114959 commit 218fa43Copy full SHA for 218fa43
1 file changed
internal/version/version.go
@@ -16,7 +16,6 @@ package version
16
17
import (
18
"os"
19
- "regexp"
20
"strings"
21
)
22
@@ -42,8 +41,9 @@ func getVersionFromEnv() string {
42
41
}
43
44
// ensurePrefix ensures that the version string has a "v" prefix.
+// Empty strings are returned as-is to avoid producing a bare "v".
45
func ensurePrefix(v string) string {
46
- if match, _ := regexp.MatchString(`^[^v]`, v); match {
+ if v != "" && !strings.HasPrefix(v, "v") {
47
return "v" + v
48
49
return v
0 commit comments