()
| 684 | var benchInput string |
| 685 | |
| 686 | func init() { |
| 687 | benchInput = "count: 4\n" |
| 688 | for i := 0; i < 1000; i++ { |
| 689 | benchInput += "pet: \"fido\"\n" |
| 690 | } |
| 691 | |
| 692 | // Check it is valid input. |
| 693 | pb := new(MyMessage) |
| 694 | err := UnmarshalText(benchInput, pb) |
| 695 | if err != nil { |
| 696 | panic("Bad benchmark input: " + err.Error()) |
| 697 | } |
| 698 | } |
| 699 | |
| 700 | func BenchmarkUnmarshalText(b *testing.B) { |
| 701 | pb := new(MyMessage) |
nothing calls this directly
no test coverage detected
searching dependent graphs…