MCPcopy
hub / github.com/jmoiron/sqlx / BenchmarkFieldNameL1

Function BenchmarkFieldNameL1

reflectx/reflect_test.go:883–892  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

881}
882
883func BenchmarkFieldNameL1(b *testing.B) {
884 e4 := E4{D: 1}
885 for i := 0; i < b.N; i++ {
886 v := reflect.ValueOf(e4)
887 f := v.FieldByName("D")
888 if f.Interface().(int) != 1 {
889 b.Fatal("Wrong value.")
890 }
891 }
892}
893
894func BenchmarkFieldNameL4(b *testing.B) {
895 e4 := E4{}

Callers

nothing calls this directly

Calls 1

FieldByNameMethod · 0.80

Tested by

no test coverage detected