From 0b5caa03e5b2d1c0c3350896ed29b95bf95fe041 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 13 Jan 2025 08:13:01 -0600 Subject: tinkering with the mutex / Marshal() problem --- repo.new.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'repo.new.go') 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 } -- cgit v1.2.3