encoding/json: remove linknames

The linknames have been removed in the latest commits:

isValidNumber, typeFields:
908af5dfaf

unquoteBytes:
8e9090a84b

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>
This commit is contained in:
Sean Liao 2025-11-17 19:16:37 +00:00
parent 5afe237d65
commit a662badab9
2 changed files with 0 additions and 33 deletions

View file

@ -1190,15 +1190,6 @@ func unquote(s []byte) (t string, ok bool) {
return 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) { func unquoteBytes(s []byte) (t []byte, ok bool) {
if len(s) < 2 || s[0] != '"' || s[len(s)-1] != '"' { if len(s) < 2 || s[0] != '"' || s[len(s)-1] != '"' {
return return

View 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 { func isValidNumber(s string) bool {
// This function implements the JSON numbers grammar. // This function implements the JSON numbers grammar.
// See https://tools.ietf.org/html/rfc7159#section-6 // See https://tools.ietf.org/html/rfc7159#section-6
@ -1101,19 +1090,6 @@ type isZeroer interface {
var isZeroerType = reflect.TypeFor[isZeroer]() 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 { func typeFields(t reflect.Type) structFields {
// Anonymous fields to explore at the current level and the next. // Anonymous fields to explore at the current level and the next.
current := []field{} current := []field{}