Skip to content

Commit

Permalink
No segments, dont bother with pre/meta
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 0d4d483 commit c3be6fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions version.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ func (v *Version) String() string {
v.buf = &bytes.Buffer{}

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

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 c3be6fc

Please sign in to comment.