aboutsummaryrefslogtreecommitdiffstats
path: root/cache
diff options
context:
space:
mode:
authorvince <vincetiu8@gmail.com>2020-08-13 20:26:41 +0800
committervince <vincetiu8@gmail.com>2020-08-13 20:26:41 +0800
commitc215861e6fe1e696e6515fdade3de1e53a1052f1 (patch)
tree68de9378150ee95f3187c7eaf50e285da6a8d73d /cache
parente9a7725ca4e1fdce33501cb1dfa1a17e9c7e6811 (diff)
downloadgit-bug-c215861e6fe1e696e6515fdade3de1e53a1052f1.tar.gz
Remove pointer and unnecessary code
Diffstat (limited to 'cache')
-rw-r--r--cache/bug_cache.go2
-rw-r--r--cache/repo_cache_test.go18
2 files changed, 1 insertions, 19 deletions
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()
-//}