From f62dd51945729f58e542892cbab8326bbed07467 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 30 Mar 2025 19:09:45 +0800 Subject: Use unsafe.SliceData instead of &b[0] --- unsafe.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) } -- cgit v1.2.3