From c215861e6fe1e696e6515fdade3de1e53a1052f1 Mon Sep 17 00:00:00 2001 From: vince Date: Thu, 13 Aug 2020 20:26:41 +0800 Subject: Remove pointer and unnecessary code --- cache/bug_cache.go | 2 +- cache/repo_cache_test.go | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) (limited to 'cache') diff --git a/cache/bug_cache.go b/cache/bug_cache.go index 01d93593..775af6d1 100644 --- a/cache/bug_cache.go +++ b/cache/bug_cache.go @@ -19,7 +19,7 @@ var ErrNoMatchingOp = fmt.Errorf("no matching operation found") // 3. Deal with concurrency. type BugCache struct { repoCache *RepoCache - mu *sync.RWMutex + mu sync.RWMutex bug *bug.WithSnapshot } diff --git a/cache/repo_cache_test.go b/cache/repo_cache_test.go index a85dd4fb..0deb155e 100644 --- a/cache/repo_cache_test.go +++ b/cache/repo_cache_test.go @@ -210,21 +210,3 @@ func TestRemove(t *testing.T) { _, err = repoCache.ResolveBug(b1.Id()) assert.Error(t, bug.ErrBugNotExist, err) } - -//func TestConcurrency(t *testing.T) { -// repo := repository.CreateTestRepo(false) -// defer repository.CleanupTestRepos(repo) -// -// cache, err := NewRepoCache(repo) -// require.NoError(t, err) -// -// iden1, err := cache.NewIdentity("René Descartes", "rene@descartes.fr") -// require.NoError(t, err) -// err = cache.SetUserIdentity(iden1) -// require.NoError(t, err) -// -// bug1, _, err := cache.NewBug("title", "message") -// require.NoError(t, err) -// -// bug1.mu.Lock() -//} -- cgit