make back to unexported:typo

This commit is contained in:
Pranjal Pandit 2016-09-13 14:36:28 +05:30
parent b205f45f51
commit 1b4adb128a
2 changed files with 4 additions and 4 deletions

View File

@ -178,7 +178,7 @@ func newShardedCache(n int, de time.Duration) *shardedCache {
return sc
}
func newSharded(defaultExpiration, cleanupInterval time.Duration, shards int) *unexportedShardedCache {
func unexportedNewSharded(defaultExpiration, cleanupInterval time.Duration, shards int) *unexportedShardedCache {
if defaultExpiration == 0 {
defaultExpiration = -1
}

View File

@ -27,7 +27,7 @@ var shardedKeys = []string{
}
func TestShardedCache(t *testing.T) {
tc := newSharded(DefaultExpiration, 0, 13)
tc := unexportedNewSharded(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 := unexportedNewSharded(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 := unexportedNewSharded(exp, 0, 20)
keys := make([]string, n)
for i := 0; i < n; i++ {
k := "foo" + strconv.Itoa(n)