Commit 551effe2 authored by Edward Muller's avatar Edward Muller
Browse files

`devel-<short sha>` is newer

Consider devel versions newer than released go versions. This may not
always be the case, but is probably the sanest default.
parent 2d182dfe
#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.
......
......@@ -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 {
......
......@@ -8,7 +8,7 @@ import (
"strings"
)
const version = 67
const version = 68
var cmdVersion = &Command{
Name: "version",
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment