summaryrefslogtreecommitdiff
path: root/goDep.parseGoSum.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-18 20:09:18 -0600
committerJeff Carr <[email protected]>2024-12-18 20:09:18 -0600
commit36fdd99d158332a1efb84c8f911e981c746bf2b0 (patch)
treeaf233e4f91ad26d5d589b8e8a529ef2b8743777a /goDep.parseGoSum.go
parent406817d5b2594f8c79dab4087c2fef811a8eff5b (diff)
this is annoyingv0.0.38
Diffstat (limited to 'goDep.parseGoSum.go')
-rw-r--r--goDep.parseGoSum.go23
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
}
/*