From a593ca9d657efb1ea021c9fc51cb528c398bbf4e Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 24 Nov 2025 08:14:18 +0000 Subject: runtime/cgo: add support for `any` param and return type When using `any` as param or return type of an exported function, we currently have the error `unrecognized Go type any`. `any` is an alias of `interface{}` which is already supported. This would avoid such change: https://github.com/php/frankenphp/pull/1976 Fixes #76340 Change-Id: I301838ff72e99ae78b035a8eff2405f6a145ed1a GitHub-Last-Rev: 7dfbccfa582bbc6e79ed29677391b9ae81a9b5bd GitHub-Pull-Request: golang/go#76325 Reviewed-on: https://go-review.googlesource.com/c/go/+/720960 Reviewed-by: Mark Freeman Auto-Submit: Ian Lance Taylor Reviewed-by: Keith Randall Reviewed-by: Ian Lance Taylor Reviewed-by: Keith Randall LUCI-TryBot-Result: Go LUCI --- src/runtime/cgocall.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/runtime') diff --git a/src/runtime/cgocall.go b/src/runtime/cgocall.go index f01353ffa6..55e7bdbdb5 100644 --- a/src/runtime/cgocall.go +++ b/src/runtime/cgocall.go @@ -796,6 +796,9 @@ func cgoCheckResult(val any) { ep := efaceOf(&val) t := ep._type + if t == nil { + return + } cgoCheckArg(t, ep.data, !t.IsDirectIface(), false, cgoResultFail) } -- cgit v1.3