summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-01 22:37:11 -0600
committerJeff Carr <[email protected]>2024-12-01 22:37:11 -0600
commit425cb042b997e9243ea19ea82bfaa9ccce484a5c (patch)
treeabe18d2864d003a1b98a67dcf4ec8b84158573f3
parentcfb5a7adc0c02ad4f5a46b212eab972f9a0d2917 (diff)
cleanup old codev0.0.17
-rw-r--r--config.go2
-rw-r--r--goDep.redoGoMod.go44
-rw-r--r--shell.go2
3 files changed, 4 insertions, 44 deletions
diff --git a/config.go b/config.go
index 3f4d976..e88a4a2 100644
--- a/config.go
+++ b/config.go
@@ -20,7 +20,7 @@ func (all *Repos) ConfigSave() error {
}
if all == nil {
log.Warn("gitpb all == nil")
- panic("why is this nil?")
+ return errors.New("gitpb.ConfigSave() all == nil")
}
data, err := all.Marshal()
diff --git a/goDep.redoGoMod.go b/goDep.redoGoMod.go
index f15ed40..91cad2f 100644
--- a/goDep.redoGoMod.go
+++ b/goDep.redoGoMod.go
@@ -92,28 +92,8 @@ func (repo *Repo) parseGoSum() (bool, error) {
repo.GoDeps = new(GoDeps)
}
repo.GoDeps.AppendUniqueGoPath(&new1)
- /*
- found := repo.FindGoDepByPath(godep)
- if found == nil {
- currentversion, ok := deps[godep]
- if ok {
- // only use the first value found in the file?
- // this shouldn't have been possible. this function should
- // only be called from MakeRedomod()
- // todo: make go things a seperate package so this function
- // isn't exported?
- if version != currentversion {
- log.Warn("\tgo.sum ", godep, "had both", version, currentversion)
- }
- } else {
- deps[godep] = version
- log.Info("\t", godep, "=", version)
- }
- */
} else {
- // I've never seen this happen yet
- panic(errors.New("go.sum invalid: " + line))
- // return false, errors.New("go.sum invalid: " + line)
+ return false, errors.New("go.sum parse error invalid: " + line)
}
}
@@ -190,28 +170,8 @@ func (repo *Repo) UpdatePublished() (bool, error) {
repo.Published = new(GoDeps)
}
repo.Published.AppendUniqueGoPath(&new1)
- /*
- found := repo.FindGoDepByPath(godep)
- if found == nil {
- currentversion, ok := deps[godep]
- if ok {
- // only use the first value found in the file?
- // this shouldn't have been possible. this function should
- // only be called from MakeRedomod()
- // todo: make go things a seperate package so this function
- // isn't exported?
- if version != currentversion {
- log.Warn("\tgo.sum ", godep, "had both", version, currentversion)
- }
- } else {
- deps[godep] = version
- log.Info("\t", godep, "=", version)
- }
- */
} else {
- // I've never seen this happen yet
- panic(errors.New("go.sum invalid: " + line))
- // return false, errors.New("go.sum invalid: " + line)
+ return false, errors.New("go.sum parse error invalid: " + line)
}
}
diff --git a/shell.go b/shell.go
index f2806d5..18aef05 100644
--- a/shell.go
+++ b/shell.go
@@ -55,7 +55,7 @@ func (repo *Repo) strictRun(cmd []string) (bool, error) {
func (repo *Repo) Exists(filename string) bool {
if repo == nil {
log.Warn("repo == nil for Exists()")
- panic(-1)
+ return false
}
testf := filepath.Join(repo.FullPath, filename)
_, err := os.Stat(testf)