From: Kévin Dunglas Date: Sat, 30 Mar 2024 09:13:39 +0000 (+0000) Subject: cmd/cgo: update outdated docs about cgocheck2 X-Git-Tag: go1.23rc1~728 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d49a14c6092ba30d0afbdaa06a24016ff1fe2a82;p=gostls13.git cmd/cgo: update outdated docs about cgocheck2 Setting GODEBUG=cgocheck=2 now panics with a message such as "fatal error: cgocheck > 1 mode is no longer supported at runtime. Use GOEXPERIMENT=cgocheck2 at build time instead." Change-Id: If9a5a96933973e14a1a60b8e9fb6a1f4a818cf59 GitHub-Last-Rev: 787d62454c31565d0828777bf5ba24c99345af4d GitHub-Pull-Request: golang/go#65224 Reviewed-on: https://go-review.googlesource.com/c/go/+/557597 Reviewed-by: Ian Lance Taylor Reviewed-by: qiulaidongfeng <2645477756@qq.com> Reviewed-by: Keith Randall Reviewed-by: Keith Randall LUCI-TryBot-Result: Go LUCI --- diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go index c2e375165c..1c5d4b060d 100644 --- a/src/cmd/cgo/doc.go +++ b/src/cmd/cgo/doc.go @@ -402,7 +402,8 @@ controlled by the cgocheck setting of the GODEBUG environment variable. The default setting is GODEBUG=cgocheck=1, which implements reasonably cheap dynamic checks. These checks may be disabled entirely using GODEBUG=cgocheck=0. Complete checking of pointer -handling, at some cost in run time, is available via GODEBUG=cgocheck=2. +handling, at some cost in run time, is available by setting +GOEXPERIMENT=cgocheck2 at build time. It is possible to defeat this enforcement by using the unsafe package, and of course there is nothing stopping the C code from doing anything