fix logic
This commit is contained in:
parent
97a2f05cf2
commit
4a64e3a7c2
|
@ -17,13 +17,20 @@ import (
|
||||||
func (repo *Repo) ParseGoSum() (bool, error) {
|
func (repo *Repo) ParseGoSum() (bool, error) {
|
||||||
// empty out what was there before
|
// empty out what was there before
|
||||||
repo.GoDeps = nil
|
repo.GoDeps = nil
|
||||||
|
|
||||||
|
// check of the repo is a primative
|
||||||
|
// that means, there is not a go.sum file
|
||||||
|
// because the package is completely self contained!
|
||||||
|
if ok, _ := repo.IsPrimitive(); ok {
|
||||||
|
log.Info("This repo is primative!")
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
tmp := filepath.Join(repo.FullPath, "go.sum")
|
tmp := filepath.Join(repo.FullPath, "go.sum")
|
||||||
gosum, err := os.Open(tmp)
|
gosum, err := os.Open(tmp)
|
||||||
|
defer gosum.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn("missing go.sum", repo.FullPath)
|
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
defer gosum.Close()
|
|
||||||
|
|
||||||
scanner := bufio.NewScanner(gosum)
|
scanner := bufio.NewScanner(gosum)
|
||||||
log.Info("gosum:", tmp)
|
log.Info("gosum:", tmp)
|
||||||
|
|
Loading…
Reference in New Issue