validate versions before running go get
This commit is contained in:
parent
a6b802d0f4
commit
3adf184a4a
|
@ -8,6 +8,7 @@ import (
|
|||
"sort"
|
||||
"strings"
|
||||
|
||||
"go.wit.com/lib/protobuf/forgepb"
|
||||
"go.wit.com/lib/protobuf/gitpb"
|
||||
"go.wit.com/log"
|
||||
)
|
||||
|
@ -64,8 +65,11 @@ func cleanGoDepsCheckOk(check *gitpb.Repo) error {
|
|||
depRepo.GetVersion(), found.GetMasterVersion(), ends)
|
||||
errs := fmt.Sprintf("%s error %s vs %s %s", depRepo.GetGoPath(),
|
||||
depRepo.GetVersion(), found.GetMasterVersion(), ends)
|
||||
cmd := []string{"go", "get", depRepo.GetGoPath() + "@" + found.GetMasterVersion()}
|
||||
fixes = append(fixes, cmd)
|
||||
if ok, _ := forgepb.ValidGoVersion(found.GetMasterVersion()); ok {
|
||||
// can't go get invalid version numbers
|
||||
cmd := []string{"go", "get", depRepo.GetGoPath() + "@" + found.GetMasterVersion()}
|
||||
fixes = append(fixes, cmd)
|
||||
}
|
||||
err = errors.New(errs)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue