From 4cac885741b845bd7f4aaad5bc9844b44eb23136 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 22 May 2024 15:46:02 -0400 Subject: all: document legacy //go:linkname for modules with ≥200 dependents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ignored these linknames which have not worked for a while: github.com/xtls/xray-core: context.newCancelCtx removed in CL 463999 (Feb 2023) github.com/u-root/u-root: funcPC removed in CL 513837 (Jul 2023) tinygo.org/x/drivers: net.useNetdev never existed For #67401. Change-Id: I9293f4ef197bb5552b431de8939fa94988a060ce Reviewed-on: https://go-review.googlesource.com/c/go/+/587576 Auto-Submit: Russ Cox Reviewed-by: Cherry Mui LUCI-TryBot-Result: Go LUCI --- src/runtime/string.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/runtime/string.go') diff --git a/src/runtime/string.go b/src/runtime/string.go index d45888b7a8..5bdb25b9db 100644 --- a/src/runtime/string.go +++ b/src/runtime/string.go @@ -78,6 +78,16 @@ func concatstring5(buf *tmpBuf, a0, a1, a2, a3, a4 string) string { // n is the length of the slice. // Buf is a fixed-size buffer for the result, // it is not nil if the result does not escape. +// +// slicebytetostring should be an internal detail, +// but widely used packages access it using linkname. +// Notable members of the hall of shame include: +// - github.com/cloudwego/frugal +// +// Do not remove or change the type signature. +// See go.dev/issue/67401. +// +//go:linkname slicebytetostring func slicebytetostring(buf *tmpBuf, ptr *byte, n int) string { if n == 0 { // Turns out to be a relatively common case. -- cgit v1.3