aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIrakli Safareli <i.safareli@gmail.com>2023-12-18 08:53:03 +0000
committerKeith Randall <khr@golang.org>2023-12-18 19:42:41 +0000
commit08bec0db3970319ef868b3c11d6cc077cab408b1 (patch)
tree16acba4b0f88af43d78d54fda0e6f48271417db1
parent2acbdd086d4660ae5e4adc429858df4758d675e3 (diff)
downloadgo-08bec0db3970319ef868b3c11d6cc077cab408b1.tar.gz
go-08bec0db3970319ef868b3c11d6cc077cab408b1.zip
builtin: mention PanicNilError in comments of recover
As of CL 461956 `recover` will not return `nil` if `panic` is called with `nil`. I have updated comments of `recover` to account for this change. Change-Id: Ibd0b27fe9b89fb29349b62ad34e762239a1d165b GitHub-Last-Rev: c773abb75c8cd8e08c3470f064a3205573156fea GitHub-Pull-Request: golang/go#64393 Reviewed-on: https://go-review.googlesource.com/c/go/+/544975 Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
-rw-r--r--src/builtin/builtin.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/builtin/builtin.go b/src/builtin/builtin.go
index da0ace1498..668c799ca7 100644
--- a/src/builtin/builtin.go
+++ b/src/builtin/builtin.go
@@ -284,9 +284,10 @@ func panic(v any)
// by restoring normal execution and retrieves the error value passed to the
// call of panic. If recover is called outside the deferred function it will
// not stop a panicking sequence. In this case, or when the goroutine is not
-// panicking, or if the argument supplied to panic was nil, recover returns
-// nil. Thus the return value from recover reports whether the goroutine is
-// panicking.
+// panicking, recover returns nil.
+//
+// Prior to Go 1.21, recover would also return nil if panic is called with
+// a nil argument. See [panic] for details.
func recover() any
// The print built-in function formats its arguments in an