diff options
| author | Jeff Carr <[email protected]> | 2025-01-13 08:13:01 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-13 08:13:01 -0600 |
| commit | 0b5caa03e5b2d1c0c3350896ed29b95bf95fe041 (patch) | |
| tree | 240e56af5bd1ef46b177d1809991939e64d3a839 /repo.new.go | |
| parent | 25ab223c07152a41f74b37ff667f6fdd329b2fe6 (diff) | |
tinkering with the mutex / Marshal() problem
Diffstat (limited to 'repo.new.go')
| -rw-r--r-- | repo.new.go | 6 |
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 } |
