Closed gracebrownecodes closed 8 years ago
OK, I think its something wrong with this code. Perhaps it should look like the below?
if version == "" {
model = revisions.Latest()
} else {
var versions []string
var found := false
for _, model = range revisions.List() {
if strings.HasPrefix(model.Version, version) {
found = true
break
}
versions = append(versions, model.Version)
}
if found == false {
fmt.Printf("model %s has versions: %s\n", model, strings.Join(versions, ", "))
os.Exit(1)
}
}
Fixed in dfab50f8649b324
This behavior seems a little strange to me:
I would expect the version argument to accept
2
instead of2.0.0
, but not to coerce2.2
(and0.3
) into2.0.0
. Also, the error reported for a1.1
input is not very informative.@bruth If you point me to the right place in the code, I would like to give fixing this a shot. Been meaning to give Go a shot for a while now...