make back to unexported:typo
This commit is contained in:
parent
b205f45f51
commit
1b4adb128a
|
@ -178,7 +178,7 @@ func newShardedCache(n int, de time.Duration) *shardedCache {
|
||||||
return sc
|
return sc
|
||||||
}
|
}
|
||||||
|
|
||||||
func newSharded(defaultExpiration, cleanupInterval time.Duration, shards int) *unexportedShardedCache {
|
func unexportedNewSharded(defaultExpiration, cleanupInterval time.Duration, shards int) *unexportedShardedCache {
|
||||||
if defaultExpiration == 0 {
|
if defaultExpiration == 0 {
|
||||||
defaultExpiration = -1
|
defaultExpiration = -1
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ var shardedKeys = []string{
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestShardedCache(t *testing.T) {
|
func TestShardedCache(t *testing.T) {
|
||||||
tc := newSharded(DefaultExpiration, 0, 13)
|
tc := unexportedNewSharded(DefaultExpiration, 0, 13)
|
||||||
for _, v := range shardedKeys {
|
for _, v := range shardedKeys {
|
||||||
tc.Set(v, "value", DefaultExpiration)
|
tc.Set(v, "value", DefaultExpiration)
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ func BenchmarkShardedCacheGetNotExpiring(b *testing.B) {
|
||||||
|
|
||||||
func benchmarkShardedCacheGet(b *testing.B, exp time.Duration) {
|
func benchmarkShardedCacheGet(b *testing.B, exp time.Duration) {
|
||||||
b.StopTimer()
|
b.StopTimer()
|
||||||
tc := newSharded(exp, 0, 10)
|
tc := unexportedNewSharded(exp, 0, 10)
|
||||||
tc.Set("foobarba", "zquux", DefaultExpiration)
|
tc.Set("foobarba", "zquux", DefaultExpiration)
|
||||||
b.StartTimer()
|
b.StartTimer()
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
|
@ -62,7 +62,7 @@ func BenchmarkShardedCacheGetManyConcurrentNotExpiring(b *testing.B) {
|
||||||
func benchmarkShardedCacheGetManyConcurrent(b *testing.B, exp time.Duration) {
|
func benchmarkShardedCacheGetManyConcurrent(b *testing.B, exp time.Duration) {
|
||||||
b.StopTimer()
|
b.StopTimer()
|
||||||
n := 10000
|
n := 10000
|
||||||
tsc := newSharded(exp, 0, 20)
|
tsc := unexportedNewSharded(exp, 0, 20)
|
||||||
keys := make([]string, n)
|
keys := make([]string, n)
|
||||||
for i := 0; i < n; i++ {
|
for i := 0; i < n; i++ {
|
||||||
k := "foo" + strconv.Itoa(n)
|
k := "foo" + strconv.Itoa(n)
|
||||||
|
|
Loading…
Reference in New Issue