(b *testing.B)
| 138 | } |
| 139 | |
| 140 | func BenchmarkBytesToString(b *testing.B) { |
| 141 | input := []byte(b.Name()) |
| 142 | |
| 143 | b.Run("copy", func(b *testing.B) { |
| 144 | b.ReportAllocs() |
| 145 | |
| 146 | for i := 0; i < b.N; i++ { |
| 147 | _tmpString = string(input) |
| 148 | } |
| 149 | }) |
| 150 | |
| 151 | b.Run("unsafe", func(b *testing.B) { |
| 152 | b.ReportAllocs() |
| 153 | |
| 154 | for i := 0; i < b.N; i++ { |
| 155 | _tmpString = BytesToString(input) |
| 156 | } |
| 157 | }) |
| 158 | } |
nothing calls this directly
no test coverage detected