summaryrefslogtreecommitdiff
path: root/repos.helpers.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-29 16:23:13 -0600
committerJeff Carr <[email protected]>2024-11-29 16:23:13 -0600
commit7615317ca72347429f665dc7db9a0fe49d86cc55 (patch)
tree0ee0b2f922e70765374178877689cb990f0fc0a8 /repos.helpers.go
parentbdcaba32f89cc635f39300aa213931c8eeffb909 (diff)
always use singular
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'repos.helpers.go')
-rw-r--r--repos.helpers.go46
1 files changed, 0 insertions, 46 deletions
diff --git a/repos.helpers.go b/repos.helpers.go
deleted file mode 100644
index 50f3277..0000000
--- a/repos.helpers.go
+++ /dev/null
@@ -1,46 +0,0 @@
-package gitpb
-
-// delete a gopath:
-// myrepos.DeleteByPath("go.wit.com/apps/go-clone")
-func (all *Repos) DeleteByPath(gopath string) *Repo {
- reposMu.Lock()
- defer reposMu.Unlock()
-
- for i, _ := range all.Repos {
- if all.Repos[i].GoPath == gopath {
- all.Repos[i] = all.Repos[len(all.Repos)-1]
- all.Repos = all.Repos[:len(all.Repos)-1]
- return nil
- }
- }
- return nil
-}
-
-// find a package by gopath
-func (all *Repos) FindByGoPath(gopath string) *Repo {
- reposMu.RLock()
- defer reposMu.RUnlock()
-
- for _, p := range all.Repos {
- if p.GoPath == gopath {
- return p
- }
- }
-
- return nil
-}
-
-// enforces no duplicate gopath's
-func (all *Repos) add(newP *Repo) bool {
- reposMu.Lock()
- defer reposMu.Unlock()
-
- for _, p := range all.Repos {
- if p.GoPath == newP.GoPath {
- return false
- }
- }
-
- all.Repos = append(all.Repos, newP)
- return true
-}