Use a type switch instead, and Use unexported NewSharded in test

This commit is contained in:
Patrick Mylund Nielsen
2012-08-17 11:35:20 +02:00
parent 13225a8ae4
commit 9cc10f6f2f
2 changed files with 28 additions and 31 deletions

View File

@@ -734,7 +734,7 @@ func BenchmarkCacheGetManyConcurrent(b *testing.B) {
func BenchmarkShardedCacheGetManyConcurrent(b *testing.B) {
b.StopTimer()
n := 10000
tsc := NewSharded(20, 0, 0)
tsc := unexportedNewSharded(20, 0, 0)
keys := make([]string, n)
for i := 0; i < n; i++ {
k := "foo" + strconv.Itoa(n)