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.
2 parents 563c262 + 793c63f commit 5a6efc0Copy full SHA for 5a6efc0
counters.go
@@ -12,3 +12,6 @@ func Decr(key string) int64 {
12
return counter[key]
13
}
14
15
+func GetCounter(key string) int64 {
16
+ return counter[key]
17
+}
tests/counters_test.go
@@ -30,4 +30,13 @@ func TestCounters(t *testing.T) {
30
t.Errorf("Error incrementing key %s", key)
31
32
})
33
+
34
+ t.Run("Get counter", func(t *testing.T) {
35
+ var key = "counter"
36
+ var expected int64 = 1
37
+ sider.Incr(key)
38
+ if sider.GetCounter(key) != expected {
39
+ t.Errorf("Error getting counter %s", key)
40
+ }
41
+ })
42
0 commit comments