Skip to content

Commit

Permalink
nil_cache.Get(): return an empty map instead of nil
Browse files Browse the repository at this point in the history
to match expectations that the returned map must be writeable.
  • Loading branch information
laurb9 committed Sep 4, 2020
1 parent 31e1fbc commit 4edfe8e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stored_requests/caches/nil_cache/nil_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import (
type NilCache struct{}

func (c *NilCache) Get(ctx context.Context, ids []string) map[string]json.RawMessage {
return nil
return make(map[string]json.RawMessage)
}

func (c *NilCache) Save(ctx context.Context, data map[string]json.RawMessage) {
return
}
Expand Down

0 comments on commit 4edfe8e

Please sign in to comment.