From fb5156a0981c2b89a118695138194e1af162ac8e Mon Sep 17 00:00:00 2001 From: Junyang Shao Date: Wed, 26 Nov 2025 19:15:51 +0000 Subject: [PATCH] testing: fix bloop doc This CL deletes the compiler detail part from bloop documentation. Change-Id: I73933707a593d4958e2300416d15e7213f001c3a Reviewed-on: https://go-review.googlesource.com/c/go/+/724800 LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase --- src/testing/benchmark.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/testing/benchmark.go b/src/testing/benchmark.go index fbd82beb84..9352e73809 100644 --- a/src/testing/benchmark.go +++ b/src/testing/benchmark.go @@ -483,14 +483,12 @@ func (b *B) loopSlowPath() bool { // the timer so cleanup code is not measured. // // Within the body of a "for b.Loop() { ... }" loop, arguments to and -// results from function calls and assignment receivers within the loop are kept +// results from function calls and assigned variables within the loop are kept // alive, preventing the compiler from fully optimizing away the loop body. // Currently, this is implemented as a compiler transformation that wraps such -// variables with a runtime.KeepAlive intrinsic call. The compiler can recursively -// walk the body of for, if statments, the cases of switch, select statments -// and bracket-braced blocks. This applies only to statements syntactically between -// the curly braces of the loop, and the loop condition must be written exactly -// as "b.Loop()". +// variables with a runtime.KeepAlive intrinsic call. This applies only to +// statements syntactically between the curly braces of the loop, and the loop +// condition must be written exactly as "b.Loop()". // // After Loop returns false, b.N contains the total number of iterations that // ran, so the benchmark may use b.N to compute other average metrics. -- 2.52.0