Skip to content

Commit

Permalink
Fix for empty versions
Browse files Browse the repository at this point in the history
Signed-off-by: Kimmo Lehto <[email protected]>
  • Loading branch information
kke committed Sep 11, 2023
1 parent c59112f commit 0d4d483
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ func (v *Version) String() string {
return v.buf.String()
}

v.buf = bytes.NewBufferString("v")
v.buf = &bytes.Buffer{}

segments := v.Segments()
if len(segments) > 0 {
v.buf.WriteRune('v')
}

for i, s := range segments {
fmt.Fprint(v.buf, strconv.Itoa(s))
if i < len(segments)-1 {
Expand Down

0 comments on commit 0d4d483

Please sign in to comment.