aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2024-05-09 15:40:34 -0700
committerGopher Robot <gobot@golang.org>2024-05-09 23:06:39 +0000
commit2064413b545876ff93d5e985824986c2e06a619a (patch)
tree98ccccc02a88748efeac1de80bedf631cd02a466
parente0aab32c7f90882ad2f6e52c03de0e22e2af5b31 (diff)
downloadgo-2064413b545876ff93d5e985824986c2e06a619a.tar.gz
go-2064413b545876ff93d5e985824986c2e06a619a.zip
reflect: restore ifaceIndir function for now
CL 583755 removed all uses of the ifaceIndir function, and the function itself. Unfortunately, ifaceIndir is accessed using go:linkname by the popular github.com/goccy/go-json package. A bug has been filed to fix this upstream: https://github.com/goccy/go-json/issues/506 Until that bug is fixed and the fix is distributed, keep this function available. With luck we can remove this in the 1.24 release. For #67279 Change-Id: I15fccf82d7a172a0b15cdbefb0a0a48381998938 Reviewed-on: https://go-review.googlesource.com/c/go/+/584676 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
-rw-r--r--src/reflect/type.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/reflect/type.go b/src/reflect/type.go
index 5ad74aabfc..47f7e45d7c 100644
--- a/src/reflect/type.go
+++ b/src/reflect/type.go
@@ -3031,3 +3031,16 @@ func TypeFor[T any]() Type {
}
return TypeOf((*T)(nil)).Elem() // only for an interface kind
}
+
+// ifaceIndir reports whether t is stored indirectly in an interface value.
+// This function is no longer called by the reflect package.
+// Unfortunately, it is accessed using go:linkname by the popular
+// github.com/goccy/go-json package.
+// A bug has been filed to fix this upstream:
+// https://github.com/goccy/go-json/issues/506
+// Until that bug is fixed and the fix is distributed,
+// keep this function available.
+// With luck we can remove this in the 1.24 release.
+func ifaceIndir(t *abi.Type) bool {
+ return t.Kind_&abi.KindDirectIface == 0
+}