diff --git a/server/util_test.go b/server/util_test.go index 6cfa6f5855a..f68de7595ff 100644 --- a/server/util_test.go +++ b/server/util_test.go @@ -24,7 +24,7 @@ func BenchmarkParseSize(b *testing.B) { } } -func deferUnlock(mu sync.Mutex) { +func deferUnlock(mu *sync.Mutex) { mu.Lock() defer mu.Unlock() } @@ -33,11 +33,11 @@ func BenchmarkDeferMutex(b *testing.B) { var mu sync.Mutex b.SetBytes(1) for i := 0; i < b.N; i++ { - deferUnlock(mu) + deferUnlock(&mu) } } -func noDeferUnlock(mu sync.Mutex) { +func noDeferUnlock(mu *sync.Mutex) { mu.Lock() mu.Unlock() } @@ -46,6 +46,6 @@ func BenchmarkNoDeferMutex(b *testing.B) { var mu sync.Mutex b.SetBytes(1) for i := 0; i < b.N; i++ { - noDeferUnlock(mu) + noDeferUnlock(&mu) } }