aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2026-01-22 15:24:51 -0500
committerCherry Mui <cherryyz@google.com>2026-02-06 13:43:05 -0800
commitfd6f333a05d672b8ca075c343cc118907fc155de (patch)
tree0feb5430cf38ea6646e887366dbc1fa669f21326
parent0e905b70ce95ad874c839ae5523b8fb8885e14ce (diff)
downloadgo-x-website-fd6f333a05d672b8ca075c343cc118907fc155de.tar.xz
_content/doc/go1.26: document testing.B.Loop change
It no longer prevents inlining. For golang/go#75005. For golang/go#73137. Change-Id: Ida9a22ef9fe5da6b4266c507de4b234d60ac625a Reviewed-on: https://go-review.googlesource.com/c/website/+/738600 Reviewed-by: Junyang Shao <shaojunyang@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
-rw-r--r--_content/doc/go1.26.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/_content/doc/go1.26.md b/_content/doc/go1.26.md
index 20cb9009..5d46e422 100644
--- a/_content/doc/go1.26.md
+++ b/_content/doc/go1.26.md
@@ -654,6 +654,14 @@ For example, in a test named `TestArtifacts`,
=== ARTIFACTS TestArtifacts /path/to/artifact/dir
```
+<!-- go.dev/issue/73137 -->
+
+The [`B.Loop`](/pkg/testing#B.Loop) method no longer prevents inlining in
+the loop body.
+Within the body of a `for b.Loop() { ... }` loop, function call parameters, results,
+and assigned variables are still kept alive, preventing the compiler from
+optimizing away the loop body.
+
#### [`testing/cryptotest`](/pkg/testing/cryptotest/)
The new [`SetGlobalRandom`](/pkg/testing/cryptotest#SetGlobalRandom) function configures a global, deterministic