From 4aa85a2f0f2e90e4df4cbf37857b800bb098c895 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 12 Jan 2025 20:05:57 -0600 Subject: [PATCH] fixes for new autogenpb --- config.go | 6 +----- gitTag.byAge.go | 4 ++-- goDep.helpers.go | 2 +- goDep.parseGoSum.go | 2 +- goDep.proto | 2 +- repo.new.go | 2 +- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/config.go b/config.go index 4d9cdb4..e59c873 100644 --- a/config.go +++ b/config.go @@ -62,11 +62,7 @@ func (all *Repos) ConfigLoad() error { func (all *Repos) sampleConfig() { newr := new(Repo) newr.FullPath = "/opt/forge/dummyentry" - if all.Append(newr) { - log.Info("added", newr.GetGoPath(), "ok") - } else { - log.Info("added", newr.GetGoPath(), "failed") - } + all.Append(newr) } func loadFile(fullname string) ([]byte, error) { diff --git a/gitTag.byAge.go b/gitTag.byAge.go index 8fa52e9..2b68b98 100644 --- a/gitTag.byAge.go +++ b/gitTag.byAge.go @@ -23,11 +23,11 @@ func (all *GitTags) newSort() *GitTagIterator { // all this code below is junk and seamingly wrong func (all *GitTags) SortByAge() *GitTagIterator { - packs := all.selectAllGitTag() + packs := all.selectAllGitTags() sort.Sort(GitTagAge(packs)) - iterator := NewGitTagIterator(packs) + iterator := newGitTagIterator(packs) return iterator } diff --git a/goDep.helpers.go b/goDep.helpers.go index bb30151..271e67b 100644 --- a/goDep.helpers.go +++ b/goDep.helpers.go @@ -13,7 +13,7 @@ func (repo *Repo) DeleteGoDepByHash(hash string) { // enforces no duplicate package names func (repo *Repo) AppendGoDep(newP *GoDep) bool { - return repo.GoDeps.AppendUniqueGoPath(newP) + return repo.GoDeps.AppendByGoPath(newP) } // returns time.Duration since last scan of go.sum & go.mod diff --git a/goDep.parseGoSum.go b/goDep.parseGoSum.go index 8a8e434..baed7f4 100644 --- a/goDep.parseGoSum.go +++ b/goDep.parseGoSum.go @@ -54,7 +54,7 @@ func (repo *Repo) ParseGoSum() bool { if repo.GoDeps == nil { repo.GoDeps = new(GoDeps) } - repo.GoDeps.AppendUniqueGoPath(&new1) + repo.GoDeps.AppendByGoPath(&new1) } else { log.Info("gitpb.ParseGoSum() go.sum parse error invalid:", line) return false diff --git a/goDep.proto b/goDep.proto index 624b9a8..8fdab1b 100644 --- a/goDep.proto +++ b/goDep.proto @@ -19,5 +19,5 @@ message GoDep { // `autogenpb:marshal` message GoDeps { // `autogenpb:marshal` string uuid = 1; // `autogenpb:uuid:` string version = 2; // `autogenpb:version` - repeated GoDep goDeps = 3; + repeated GoDep goDeps = 3; // `autogenpb:unique` `autogenpb:sort` } diff --git a/repo.new.go b/repo.new.go index 8ebe78c..f229dcc 100644 --- a/repo.new.go +++ b/repo.new.go @@ -34,7 +34,7 @@ func (all *Repos) NewGoRepo(fullpath string, gopath string) (*Repo, error) { // everything happens in here newr.Reload() - if all.AppendUniqueFullPath(&newr) { + if all.AppendByFullPath(&newr) { // worked return &newr, nil } else {