refactor compare versions

This commit is contained in:
kevin
2020-08-10 14:53:01 +08:00
parent 4c9b481bdf
commit 6aa7a319c2
3 changed files with 60 additions and 75 deletions

View File

@@ -24,9 +24,10 @@ func BenchmarkOnce(b *testing.B) {
add := Once(func() {
v++
})
b.ResetTimer()
for i:=0;i<b.N;i++{
for i := 0; i < b.N; i++ {
add()
}
assert.Equal(b, 1, v)
}
}