summaryrefslogtreecommitdiff
path: root/repo.helpers.go
diff options
context:
space:
mode:
Diffstat (limited to 'repo.helpers.go')
-rw-r--r--repo.helpers.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/repo.helpers.go b/repo.helpers.go
new file mode 100644
index 0000000..f23393c
--- /dev/null
+++ b/repo.helpers.go
@@ -0,0 +1,18 @@
+package gitpb
+
+// this is becoming a standard format
+// todo: autogenerate this from the .proto file?
+
+func (all *Repos) DeleteByPath(gopath string) *Repo {
+ repolock.Lock()
+ defer repolock.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
+}