aboutsummaryrefslogtreecommitdiff
path: root/unsafe.go
diff options
context:
space:
mode:
Diffstat (limited to 'unsafe.go')
-rw-r--r--unsafe.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/unsafe.go b/unsafe.go
index 418a910..81c1808 100644
--- a/unsafe.go
+++ b/unsafe.go
@@ -16,5 +16,5 @@ func stringToBytes(s string) (bytes []byte) {
// Memory is borrowed from the byte slice.
// The source byte slice must not be modified.
func bytesToString(b []byte) string {
- return unsafe.String(&b[0], len(b))
+ return unsafe.String(unsafe.SliceData(b), len(b))
}