]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/json: remove linknames
authorSean Liao <sean@liao.dev>
Mon, 17 Nov 2025 19:16:37 +0000 (19:16 +0000)
committerSean Liao <sean@liao.dev>
Thu, 20 Nov 2025 22:04:37 +0000 (14:04 -0800)
The linknames have been removed in the latest commits:

isValidNumber, typeFields:
https://github.com/bytedance/sonic/commit/908af5dfaf7d509db1f2c2b1c43f4df728db80a6

unquoteBytes:
https://github.com/bytedance/sonic/commit/8e9090a84be10962046197f1867d297d3e73020a

For #67401

Change-Id: I30b057137932fcf267014ab5470c417298765249
Reviewed-on: https://go-review.googlesource.com/c/go/+/721160
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
src/encoding/json/decode.go
src/encoding/json/encode.go

index 46f9ed2da9bc7535e09bafb1c204e8c941cec084..5ff1014dc506444a01b1c256bccdf9234c96a247 100644 (file)
@@ -1190,15 +1190,6 @@ func unquote(s []byte) (t string, ok bool) {
        return
 }
 
-// unquoteBytes should be an internal detail,
-// but widely used packages access it using linkname.
-// Notable members of the hall of shame include:
-//   - github.com/bytedance/sonic
-//
-// Do not remove or change the type signature.
-// See go.dev/issue/67401.
-//
-//go:linkname unquoteBytes
 func unquoteBytes(s []byte) (t []byte, ok bool) {
        if len(s) < 2 || s[0] != '"' || s[len(s)-1] != '"' {
                return
index 1b7942dd3ad3f4e70e728a2a0a0f4b876d385a07..9bdc270f85eda1bd8205ca6d9e52d5c6341fba85 100644 (file)
@@ -633,17 +633,6 @@ func stringEncoder(e *encodeState, v reflect.Value, opts encOpts) {
        }
 }
 
-// isValidNumber reports whether s is a valid JSON number literal.
-//
-// isValidNumber should be an internal detail,
-// but widely used packages access it using linkname.
-// Notable members of the hall of shame include:
-//   - github.com/bytedance/sonic
-//
-// Do not remove or change the type signature.
-// See go.dev/issue/67401.
-//
-//go:linkname isValidNumber
 func isValidNumber(s string) bool {
        // This function implements the JSON numbers grammar.
        // See https://tools.ietf.org/html/rfc7159#section-6
@@ -1101,19 +1090,6 @@ type isZeroer interface {
 
 var isZeroerType = reflect.TypeFor[isZeroer]()
 
-// typeFields returns a list of fields that JSON should recognize for the given type.
-// The algorithm is breadth-first search over the set of structs to include - the top struct
-// and then any reachable anonymous structs.
-//
-// typeFields should be an internal detail,
-// but widely used packages access it using linkname.
-// Notable members of the hall of shame include:
-//   - github.com/bytedance/sonic
-//
-// Do not remove or change the type signature.
-// See go.dev/issue/67401.
-//
-//go:linkname typeFields
 func typeFields(t reflect.Type) structFields {
        // Anonymous fields to explore at the current level and the next.
        current := []field{}