We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 748dcdf commit 1c55c11Copy full SHA for 1c55c11
clientprovider_test.go
@@ -1,6 +1,7 @@
1
package g8
2
3
import (
4
+ "sync"
5
"testing"
6
"time"
7
@@ -75,18 +76,23 @@ func TestClientProvider_WithCacheAndExpiration(t *testing.T) {
75
76
77
type customCache struct {
78
entries map[string]any
79
+ sync.Mutex
80
}
81
82
func (c *customCache) Get(key string) (value any, exists bool) {
83
+ c.Lock()
84
v, exists := c.entries[key]
85
+ c.Unlock()
86
return v, exists
87
88
89
func (c *customCache) Set(key string, value any) {
90
91
if c.entries == nil {
92
c.entries = make(map[string]any)
93
94
c.entries[key] = value
95
96
97
98
var _ Cache = (*customCache)(nil)
0 commit comments