Merge pull request #82 from stickycode/develop

Use the original tag not the SemVer-ified one
pull/83/head
Karolis Rusenas 2017-08-06 11:07:11 +01:00 committed by GitHub
commit 3202c3fd9d
2 changed files with 8 additions and 1 deletions

View File

@ -110,7 +110,7 @@ func NewAvailable(current string, tags []string) (newVersion string, newAvailabl
sort.Sort(sort.Reverse(semver.Collection(vs)))
if currentVersion.LessThan(vs[0]) {
return vs[0].String(), true, nil
return vs[0].Original(), true, nil
}
return "", false, nil
}

View File

@ -276,6 +276,13 @@ func TestNewAvailable(t *testing.T) {
wantNewAvailable: true,
wantErr: false,
},
{
name: "simple semver",
args: args{current: "8.1", tags: []string{"8.1", "8.2", "8.3"}},
wantNewVersion: "8.3",
wantNewAvailable: true,
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {