mirror of
https://github.com/netbirdio/easyjson.git
synced 2026-05-22 18:44:42 -07:00
benchmark for isNilInterface
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package easyjson
|
||||
|
||||
import "testing"
|
||||
|
||||
func BenchmarkNilCheck(b *testing.B) {
|
||||
var a *int
|
||||
for i := 0; i < b.N; i++ {
|
||||
if !isNilInterface(a) {
|
||||
b.Fatal("expected it to be nil")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user