diff options
Diffstat (limited to 'goDep.parseGoSum.go')
| -rw-r--r-- | goDep.parseGoSum.go | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/goDep.parseGoSum.go b/goDep.parseGoSum.go index b2b3d04..e99e61e 100644 --- a/goDep.parseGoSum.go +++ b/goDep.parseGoSum.go @@ -4,7 +4,6 @@ package gitpb import ( "bufio" - "errors" "os" "path/filepath" "strings" @@ -14,25 +13,27 @@ import ( // reads and parses the go.sum file // does not change anything -func (repo *Repo) ParseGoSum() (bool, error) { +func (repo *Repo) ParseGoSum() bool { // empty out what was there before repo.GoDeps = nil // check of the repo is a primitive // that means, there is not a go.sum file // because the package is completely self contained! - if err := repo.SetPrimitive(); err != nil { - return false, err + if err := repo.setPrimitive(); err != nil { + log.Info("gitpb.ParseGoSum()", err) + return false } if repo.GetGoPrimitive() { - log.Info("This repo is primitive!") - return true, nil + // log.Info("This repo is primitive!") + return true } tmp := filepath.Join(repo.FullPath, "go.sum") gosum, err := os.Open(tmp) defer gosum.Close() if err != nil { - return false, err + log.Info("gitpb.ParseGoSum()", err) + return false } scanner := bufio.NewScanner(gosum) @@ -56,15 +57,17 @@ func (repo *Repo) ParseGoSum() (bool, error) { } repo.GoDeps.AppendUniqueGoPath(&new1) } else { - return false, errors.New("go.sum parse error invalid: " + line) + log.Info("gitpb.ParseGoSum() go.sum parse error invalid:", line) + return false } } if err := scanner.Err(); err != nil { repo.GoDeps = nil - return false, err + log.Info("gitpb.ParseGoSum()", err) + return false } - return true, nil + return true } /* |
