summaryrefslogtreecommitdiff
path: root/repo.new.go
diff options
context:
space:
mode:
Diffstat (limited to 'repo.new.go')
-rw-r--r--repo.new.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/repo.new.go b/repo.new.go
index c073fad..39dd303 100644
--- a/repo.new.go
+++ b/repo.new.go
@@ -51,14 +51,16 @@ func (all *Repos) NewGoRepo(fullpath string, gopath string) (*Repo, error) {
// enforces GoPath is unique
func (all *Repos) AppendByGoPath(newr *Repo) bool {
all.RLock()
- defer all.RUnlock()
for _, r := range all.Repos {
if r.GoInfo.GoPath == newr.GoInfo.GoPath {
+ all.RUnlock()
return false
}
}
+ all.RUnlock()
- all.Repos = append(all.Repos, newr)
+ // all.Repos = append(all.Repos, newr)
+ all.Append(newr)
return true
}