summaryrefslogtreecommitdiff
path: root/repo.helpers.go
diff options
context:
space:
mode:
Diffstat (limited to 'repo.helpers.go')
-rw-r--r--repo.helpers.go32
1 files changed, 0 insertions, 32 deletions
diff --git a/repo.helpers.go b/repo.helpers.go
deleted file mode 100644
index 3c33583..0000000
--- a/repo.helpers.go
+++ /dev/null
@@ -1,32 +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
-}
-
-// 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
-}