diff --git a/sharded.go b/sharded.go index 7df0943..04f59a9 100644 --- a/sharded.go +++ b/sharded.go @@ -178,7 +178,7 @@ func newShardedCache(n int, de time.Duration) *shardedCache { return sc } -func NewSharded(defaultExpiration, cleanupInterval time.Duration, shards int) *unexportedShardedCache { +func newSharded(defaultExpiration, cleanupInterval time.Duration, shards int) *unexportedShardedCache { if defaultExpiration == 0 { defaultExpiration = -1 } diff --git a/sharded_test.go b/sharded_test.go index 384ed59..d1c34fc 100644 --- a/sharded_test.go +++ b/sharded_test.go @@ -27,7 +27,7 @@ var shardedKeys = []string{ } func TestShardedCache(t *testing.T) { - tc := NewSharded(DefaultExpiration, 0, 13) + tc := newSharded(DefaultExpiration, 0, 13) for _, v := range shardedKeys { tc.Set(v, "value", DefaultExpiration) } @@ -43,7 +43,7 @@ func BenchmarkShardedCacheGetNotExpiring(b *testing.B) { func benchmarkShardedCacheGet(b *testing.B, exp time.Duration) { b.StopTimer() - tc := NewSharded(exp, 0, 10) + tc := newSharded(exp, 0, 10) tc.Set("foobarba", "zquux", DefaultExpiration) b.StartTimer() for i := 0; i < b.N; i++ { @@ -62,7 +62,7 @@ func BenchmarkShardedCacheGetManyConcurrentNotExpiring(b *testing.B) { func benchmarkShardedCacheGetManyConcurrent(b *testing.B, exp time.Duration) { b.StopTimer() n := 10000 - tsc := NewSharded(exp, 0, 20) + tsc := newSharded(exp, 0, 20) keys := make([]string, n) for i := 0; i < n; i++ { k := "foo" + strconv.Itoa(n)