diff options
| author | Jeff Carr <[email protected]> | 2024-11-27 14:55:39 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-27 14:55:39 -0600 |
| commit | 8b987962ea21a827d50e7f7430ab58b47274ad0e (patch) | |
| tree | 7df7d5799965e82fbe2cd6ae2de4b0204536df1f | |
| parent | c9d99d669347dd11ea12ced051f049fc6cfbfab0 (diff) | |
fun stuff
| -rw-r--r-- | repo.helpers.go | 2 | ||||
| -rw-r--r-- | repo.new.go | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/repo.helpers.go b/repo.helpers.go index 7cc6d5a..3420526 100644 --- a/repo.helpers.go +++ b/repo.helpers.go @@ -17,7 +17,7 @@ func (all *Repos) DeleteByPath(gopath string) *Repo { } // find a package by gopath -func (all *Repos) FindByPath(gopath string) *Repo { +func (all *Repos) FindByGoPath(gopath string) *Repo { repolock.RLock() defer repolock.RUnlock() diff --git a/repo.new.go b/repo.new.go index f599c93..c7f000f 100644 --- a/repo.new.go +++ b/repo.new.go @@ -9,10 +9,10 @@ import ( // TODO: try adding python, rails, perl, rust, other language things? // I probably will never have time to try that, but I'd take patches for anyone // that might see this note and feel so inclined. -func (r *Repos) InitNewGoPath(basepath string, gopath string) *Repo { - if oldr := r.FindByPath(gopath); oldr != nil { +func (all *Repos) NewGoPath(basepath string, gopath string) *Repo { + if r := all.FindByGoPath(gopath); r != nil { // already had this gopath - return oldr + return r } // add a new one here newr := Repo{ @@ -21,6 +21,6 @@ func (r *Repos) InitNewGoPath(basepath string, gopath string) *Repo { } newr.UpdateGit() - r.add(&newr) + all.add(&newr) return &newr } |
