fix logic

This commit is contained in:
Jeff Carr 2024-12-03 22:36:06 -06:00
parent 97a2f05cf2
commit 4a64e3a7c2
1 changed files with 9 additions and 2 deletions

View File

@ -17,13 +17,20 @@ import (
func (repo *Repo) ParseGoSum() (bool, error) {
// empty out what was there before
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")
gosum, err := os.Open(tmp)
defer gosum.Close()
if err != nil {
log.Warn("missing go.sum", repo.FullPath)
return false, err
}
defer gosum.Close()
scanner := bufio.NewScanner(gosum)
log.Info("gosum:", tmp)