diff options
| author | Russ Cox <rsc@golang.org> | 2024-05-22 23:06:30 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-05-29 17:58:53 +0000 |
| commit | 2a7ca156b8189c68c0a29b4c66194a42c5ce3c9b (patch) | |
| tree | 7ac6dc198ebad85420719774562d29b7b59c6684 /src/bytes | |
| parent | 5121b45d7426687076c20ae0f4fcae1238f3ed47 (diff) | |
| download | go-2a7ca156b8189c68c0a29b4c66194a42c5ce3c9b.tar.xz | |
all: document legacy //go:linkname for final round of modules
Add linknames for most modules with ≥50 dependents.
Add linknames for a few other modules that we know
are important but are below 50.
Remove linknames from badlinkname.go that do not merit
inclusion (very small number of dependents).
We can add them back later if the need arises.
Fixes #67401. (For now.)
Change-Id: I1e49fec0292265256044d64b1841d366c4106002
Reviewed-on: https://go-review.googlesource.com/c/go/+/587756
Auto-Submit: Russ Cox <rsc@golang.org>
TryBot-Bypass: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/bytes')
| -rw-r--r-- | src/bytes/bytes.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/bytes/bytes.go b/src/bytes/bytes.go index 23edd5a4be..2a07d2084e 100644 --- a/src/bytes/bytes.go +++ b/src/bytes/bytes.go @@ -10,6 +10,7 @@ import ( "internal/bytealg" "unicode" "unicode/utf8" + _ "unsafe" // for linkname ) // Equal reports whether a and b @@ -568,6 +569,18 @@ func Map(mapping func(r rune) rune, s []byte) []byte { return b } +// Despite being an exported symbol, +// Repeat is linknamed by widely used packages. +// Notable members of the hall of shame include: +// - gitee.com/quant1x/num +// +// Do not remove or change the type signature. +// See go.dev/issue/67401. +// +// Note that this comment is not part of the doc comment. +// +//go:linkname Repeat + // Repeat returns a new byte slice consisting of count copies of b. // // It panics if count is negative or if the result of (len(b) * count) |
