more restructure
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
c51b8c96b1
commit
c87e162518
|
@ -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
|
||||
}
|
14
repo.sort.go
14
repo.sort.go
|
@ -134,17 +134,3 @@ func (all *Repos) selectAllRepo() []*Repo {
|
|||
|
||||
return aRepos
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue