(b *testing.B)
| 747 | ` |
| 748 | |
| 749 | func BenchmarkCode(b *testing.B) { |
| 750 | b.ReportAllocs() |
| 751 | for i := 0; i < b.N; i++ { |
| 752 | w := NewWriter(io.Discard, 4, 4, 1, ' ', 0) // no particular reason for these settings |
| 753 | // The code is small, so it's reasonable for the tabwriter user |
| 754 | // to write it all at once, or buffer the writes. |
| 755 | w.Write([]byte(codeSnippet)) |
| 756 | w.Flush() |
| 757 | } |
| 758 | } |