From 05cbbf985fed823a174bf95cc78a7d44f948fdab Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 22 May 2024 15:03:13 -0400 Subject: all: document legacy //go:linkname for modules with ≥500 dependents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For #67401. Change-Id: I7dd28c3b01a1a647f84929d15412aa43ab0089ee Reviewed-on: https://go-review.googlesource.com/c/go/+/587575 Reviewed-by: Cherry Mui Auto-Submit: Russ Cox LUCI-TryBot-Result: Go LUCI --- src/internal/bytealg/compare_generic.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/internal/bytealg') diff --git a/src/internal/bytealg/compare_generic.go b/src/internal/bytealg/compare_generic.go index 8c08b7e6f5..74126ae805 100644 --- a/src/internal/bytealg/compare_generic.go +++ b/src/internal/bytealg/compare_generic.go @@ -39,6 +39,16 @@ func CompareString(a, b string) int { return runtime_cmpstring(a, b) } +// runtime.cmpstring calls are emitted by the compiler. +// +// runtime.cmpstring should be an internal detail, +// but widely used packages access it using linkname. +// Notable members of the hall of shame include: +// - github.com/bytedance/gopkg +// +// Do not remove or change the type signature. +// See go.dev/issue/67401. +// //go:linkname runtime_cmpstring runtime.cmpstring func runtime_cmpstring(a, b string) int { l := len(a) -- cgit v1.3-5-g9baa