bytesToString converts a byte slice to a string. String shares the memory with the byte slice. The byte slice should not be modified after call.
(b []byte)
| 56 | // String shares the memory with the byte slice. |
| 57 | // The byte slice should not be modified after call. |
| 58 | func bytesToString(b []byte) string { return unsafe.String(unsafe.SliceData(b), len(b)) } |
| 59 | |
| 60 | // addressOfBytes returns the address of the first byte in data. |
| 61 | // The data should not be modified after call. |