Skip to content
This repository has been archived by the owner on Feb 26, 2019. It is now read-only.

Commit

Permalink
devel-<short sha> is newer
Browse files Browse the repository at this point in the history
Consider devel versions newer than released go versions. This may not
always be the case, but is probably the sanest default.
  • Loading branch information
Edward Muller committed May 16, 2016
1 parent 2d182df commit 551effe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#v68 (2016/06/16)

* `devel-<short sha>` is always considered newer than any released go version

#v67 (2016/06/13)

* Attempt to handle missing deps a little better.
Expand Down
1 change: 1 addition & 0 deletions match_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func TestIsSameOrNewer(t *testing.T) {
{`go1.6`, `go1.6`, true},
{`go1.5`, `go1.6`, true},
{`go1.7`, `go1.6`, false},
{`go1.6`, `devel-8f48efb`, true}, // devel versions are always never
}

for _, test := range cases {
Expand Down
5 changes: 4 additions & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
)

const version = 67
const version = 68

var cmdVersion = &Command{
Name: "version",
Expand Down Expand Up @@ -39,6 +39,9 @@ func isSameOrNewer(base, check string) bool {
if base == check {
return true
}
if strings.HasPrefix(check, "devel-") {
return true
}
bp := strings.FieldsFunc(base, GoVersionFields)
cp := strings.FieldsFunc(check, GoVersionFields)
if len(bp) < 2 || len(cp) < 2 {
Expand Down

0 comments on commit 551effe

Please sign in to comment.