diff --git a/README.md b/README.md index 4e6c1b2..cde0781 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # version -A go-language package for managing [k0s](https://github.com/k0sproject/k0s) version numbers. It is based on [hashicorp/go-version](https://github.com/hashicorp/go-version) but adds sorting and comparison capabilities for the k0s version numbering scheme. +A go-language package for managing [k0s](https://github.com/k0sproject/k0s) version numbers. It is based on [hashicorp/go-version](https://github.com/hashicorp/go-version) but adds sorting and comparison capabilities for the k0s version numbering scheme which requires additional sorting by the build tag. ## Usage diff --git a/collection.go b/collection.go index b754f15..fa3000a 100644 --- a/collection.go +++ b/collection.go @@ -7,7 +7,7 @@ import "fmt" type Collection []*Version func NewCollection(versions ...string) (Collection, error) { - c := make(Collection, len(versions), len(versions)) + c := make(Collection, len(versions)) for i, v := range versions { nv, err := NewVersion(v) if err != nil { diff --git a/version_test.go b/version_test.go index ba0b5e9..bb93bab 100644 --- a/version_test.go +++ b/version_test.go @@ -10,7 +10,7 @@ func TestNewVersion(t *testing.T) { v, err := NewVersion("1.23.3+k0s.1") assert.NoError(t, err) assert.Equal(t, "1.23.3+k0s.1", v.String()) - v, err = NewVersion("1.23.b+k0s.1") + _, err = NewVersion("1.23.b+k0s.1") assert.Error(t, err) }