BytesToString converts byte slice to string without a memory allocation. For more details, see https://github.com/golang/go/issues/53003#issuecomment-1140276077.
(b []byte)
| 17 | // BytesToString converts byte slice to string without a memory allocation. |
| 18 | // For more details, see https://github.com/golang/go/issues/53003#issuecomment-1140276077. |
| 19 | func BytesToString(b []byte) string { |
| 20 | return unsafe.String(unsafe.SliceData(b), len(b)) |
| 21 | } |