summaryrefslogtreecommitdiff
path: root/repo.helpers.go
blob: f23393c5969c8ef413c5df53dac70747a4a5a303 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
}