runtime/cgo: fix cgoCheckArg description

The description is misleading: cgoCheckArg is called by both
cgoCheckPointer and cgoCheckResult.

Mention cgoCheckResult in the cgoCheckArg description. Remove extra
spaces between words.

For #75856

Change-Id: I6780cda76b5cb7b4f9af3fbaa37a6c5099cc8d7d
GitHub-Last-Rev: 531928b679
GitHub-Pull-Request: golang/go#75992
Reviewed-on: https://go-review.googlesource.com/c/go/+/713520
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Ariel Otilibili 2025-10-22 08:36:51 +00:00 committed by t hepudds
parent 50586182ab
commit f92e01c117

View file

@ -594,9 +594,9 @@ func cgoCheckPointer(ptr any, arg any) {
const cgoCheckPointerFail = "cgo argument has Go pointer to unpinned Go pointer"
const cgoResultFail = "cgo result is unpinned Go pointer or points to unpinned Go pointer"
// cgoCheckArg is the real work of cgoCheckPointer. The argument p
// is either a pointer to the value (of type t), or the value itself,
// depending on indir. The top parameter is whether we are at the top
// cgoCheckArg is the real work of cgoCheckPointer and cgoCheckResult.
// The argument p is either a pointer to the value (of type t), or the value
// itself, depending on indir. The top parameter is whether we are at the top
// level, where Go pointers are allowed. Go pointers to pinned objects are
// allowed as long as they don't reference other unpinned pointers.
func cgoCheckArg(t *_type, p unsafe.Pointer, indir, top bool, msg string) {