(b *testing.B)
| 881 | } |
| 882 | |
| 883 | func 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 | |
| 894 | func BenchmarkFieldNameL4(b *testing.B) { |
| 895 | e4 := E4{} |
nothing calls this directly
no test coverage detected