aboutsummaryrefslogtreecommitdiffstats
path: root/cache
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-29 18:11:33 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-29 18:51:56 +0200
commit6363518c85cbd8247a5f6507b8a1dd3903cfb71d (patch)
treeaa51652e9881196b3637247988cbd5155f42b5e2 /cache
parentff2fd14e3f10a7206d4ec86f07e524cfa290e0fc (diff)
downloadgit-bug-6363518c85cbd8247a5f6507b8a1dd3903cfb71d.tar.gz
relay connection working with gqlgen
Diffstat (limited to 'cache')
-rw-r--r--cache/cache.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/cache/cache.go b/cache/cache.go
index c440646e..779b95b0 100644
--- a/cache/cache.go
+++ b/cache/cache.go
@@ -27,7 +27,7 @@ type RepoCacher interface {
}
type BugCacher interface {
- Snapshot() bug.Snapshot
+ Snapshot() *bug.Snapshot
ClearSnapshot()
}
@@ -37,8 +37,8 @@ type RootCache struct {
repos map[string]RepoCacher
}
-func NewCache() Cacher {
- return &RootCache{
+func NewCache() RootCache {
+ return RootCache{
repos: make(map[string]RepoCacher),
}
}
@@ -172,12 +172,12 @@ func NewBugCache(b *bug.Bug) BugCacher {
}
}
-func (c BugCache) Snapshot() bug.Snapshot {
+func (c BugCache) Snapshot() *bug.Snapshot {
if c.snap == nil {
snap := c.bug.Compile()
c.snap = &snap
}
- return *c.snap
+ return c.snap
}
func (c BugCache) ClearSnapshot() {