aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorEvan Jones <ej@evanjones.ca>2023-10-31 09:04:15 -0400
committerGopher Robot <gobot@golang.org>2023-11-06 18:01:18 +0000
commit0354ee3aab4b65e288a24c5b4be1296ffbbfd3c3 (patch)
tree2fa05427dcdad8845dc224f43342b7e0306bd0b2 /src/testing
parentd5b5ab929bf49403de3e2b61e9e771e775893d01 (diff)
downloadgo-0354ee3aab4b65e288a24c5b4be1296ffbbfd3c3.tar.gz
go-0354ee3aab4b65e288a24c5b4be1296ffbbfd3c3.zip
testing: correct comments on runCleanup
The comment on runCleanup states "If catchPanic is true ...", but there is no catchPanic argument or variable. This was introduced in CL 214822, which introduced the panicHandling type. The code was updated during code review, but the comment was missed. Change-Id: Id14c5397e7a026bfdf98ea10ecb1e4c61ce2f924 Reviewed-on: https://go-review.googlesource.com/c/go/+/538695 Auto-Submit: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/testing.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/testing/testing.go b/src/testing/testing.go
index 6e277a40f9..a137fae890 100644
--- a/src/testing/testing.go
+++ b/src/testing/testing.go
@@ -1306,7 +1306,7 @@ func (c *common) Setenv(key, value string) {
}
}
-// panicHanding is an argument to runCleanup.
+// panicHanding controls the panic handling used by runCleanup.
type panicHandling int
const (
@@ -1315,8 +1315,8 @@ const (
)
// runCleanup is called at the end of the test.
-// If catchPanic is true, this will catch panics, and return the recovered
-// value if any.
+// If ph is recoverAndReturnPanic, it will catch panics, and return the
+// recovered value if any.
func (c *common) runCleanup(ph panicHandling) (panicVal any) {
c.cleanupStarted.Store(true)
defer c.cleanupStarted.Store(false)