MCPcopy Index your code
hub / github.com/labstack/echo / BenchmarkDefaultBinder_BindInt64_10_fields

Function BenchmarkDefaultBinder_BindInt64_10_fields

binder_test.go:2968–2993  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

2966}
2967
2968func BenchmarkDefaultBinder_BindInt64_10_fields(b *testing.B) {
2969 type Opts struct {
2970 String string `query:"string"`
2971 Strings []string `query:"strings"`
2972 Int64 int64 `query:"int64"`
2973 Uint64 uint64 `query:"uint64"`
2974 Int32 int32 `query:"int32"`
2975 Uint32 uint32 `query:"uint32"`
2976 Int16 int16 `query:"int16"`
2977 Uint16 uint16 `query:"uint16"`
2978 Int8 int8 `query:"int8"`
2979 Uint8 uint8 `query:"uint8"`
2980 }
2981 c := createTestContext("/search?int64=1&int32=2&int16=3&int8=4&string=test&uint64=5&uint32=6&uint16=7&uint8=8&strings=first&strings=second", nil, nil)
2982
2983 b.ReportAllocs()
2984 b.ResetTimer()
2985 binder := new(DefaultBinder)
2986 for i := 0; i < b.N; i++ {
2987 var dest Opts
2988 _ = binder.Bind(c, &dest)
2989 if dest.Int64 != 1 {
2990 b.Fatalf("int64!=1")
2991 }
2992 }
2993}
2994
2995func BenchmarkValueBinder_BindInt64_10_fields(b *testing.B) {
2996 type Opts struct {

Callers

nothing calls this directly

Calls 2

createTestContextFunction · 0.85
BindMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…