fun stuff
This commit is contained in:
parent
c9d99d6693
commit
8b987962ea
|
@ -17,7 +17,7 @@ func (all *Repos) DeleteByPath(gopath string) *Repo {
|
||||||
}
|
}
|
||||||
|
|
||||||
// find a package by gopath
|
// find a package by gopath
|
||||||
func (all *Repos) FindByPath(gopath string) *Repo {
|
func (all *Repos) FindByGoPath(gopath string) *Repo {
|
||||||
repolock.RLock()
|
repolock.RLock()
|
||||||
defer repolock.RUnlock()
|
defer repolock.RUnlock()
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,10 @@ import (
|
||||||
// TODO: try adding python, rails, perl, rust, other language things?
|
// TODO: try adding python, rails, perl, rust, other language things?
|
||||||
// I probably will never have time to try that, but I'd take patches for anyone
|
// I probably will never have time to try that, but I'd take patches for anyone
|
||||||
// that might see this note and feel so inclined.
|
// that might see this note and feel so inclined.
|
||||||
func (r *Repos) InitNewGoPath(basepath string, gopath string) *Repo {
|
func (all *Repos) NewGoPath(basepath string, gopath string) *Repo {
|
||||||
if oldr := r.FindByPath(gopath); oldr != nil {
|
if r := all.FindByGoPath(gopath); r != nil {
|
||||||
// already had this gopath
|
// already had this gopath
|
||||||
return oldr
|
return r
|
||||||
}
|
}
|
||||||
// add a new one here
|
// add a new one here
|
||||||
newr := Repo{
|
newr := Repo{
|
||||||
|
@ -21,6 +21,6 @@ func (r *Repos) InitNewGoPath(basepath string, gopath string) *Repo {
|
||||||
}
|
}
|
||||||
newr.UpdateGit()
|
newr.UpdateGit()
|
||||||
|
|
||||||
r.add(&newr)
|
all.add(&newr)
|
||||||
return &newr
|
return &newr
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue