]> Cypherpunks repositories - gostls13.git/log
gostls13.git
23 hours ago[release-branch.go1.26] cmd/go: update VCS commands to use safer flag/argument syntax
Roland Shoemaker [Wed, 10 Dec 2025 13:13:07 +0000 (08:13 -0500)]
[release-branch.go1.26] cmd/go: update VCS commands to use safer flag/argument syntax

In various situations, the toolchain invokes VCS commands. Some of these
commands take arbitrary input, either provided by users or fetched from
external sources. To prevent potential command injection vulnerabilities
or misinterpretation of arguments as flags, this change updates the VCS
commands to use various techniques to separate flags from positional
arguments, and to directly associate flags with their values.

Additionally, we update the environment variable for Mercurial to use
`HGPLAIN=+strictflags`, which is the more explicit way to disable user
configurations (intended or otherwise) that might interfere with command
execution.

We also now disallow version strings from being prefixed with '-' or
'/', as doing so opens us up to making the same mistake again in the
future. As far as we know there are currently ~0 public modules affected
by this.

While I was working on cmd/go/internal/vcs, I also noticed that a
significant portion of the commands being implemented were dead code.
In order to reduce the maintenance burden and surface area for potential
issues, I removed the dead code for unused commands.

We should probably follow up with a more structured change to make it
harder to accidentally re-introduce these issues in the future, but for
now this addresses the issue at hand.

Thanks to splitline (@splitline) from DEVCORE Research Team for
reporting this issue.

Fixes CVE-2025-68119
Fixes #77099

Change-Id: I9d9f4ee05b95be49fe14edf71a1b8e6c0784378e
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3260
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3341
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736705
Auto-Submit: Michael Pratt <mpratt@google.com>
TryBot-Bypass: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
23 hours ago[release-branch.go1.26] crypto/tls: don't copy auto-rotated session ticket keys in...
Roland Shoemaker [Tue, 6 Jan 2026 22:36:01 +0000 (14:36 -0800)]
[release-branch.go1.26] crypto/tls: don't copy auto-rotated session ticket keys in Config.Clone

Once a tls.Config is used, it is not safe to mutate. We provide the
Clone method in order to allow users to copy and modify a Config that
is in use.

If Config.SessionTicketKey is not populated, and if
Config.SetSessionTicketKeys has not been called, we automatically
populate and rotate session ticket keys. Clone was previously copying
these keys into the new Config, meaning that two Configs could share
the same auto-rotated session ticket keys. This could allow sessions to
be resumed across different Configs, which may have completely different
configurations.

This change updates Clone to not copy the auto-rotated session ticket
keys.

Additionally, when resuming a session, check that not just that the leaf
certificate is unexpired, but that the entire certificate chain is still
unexpired.

Fixes #77113
Fixes CVE-2025-68121

Change-Id: I011df7329de83068d11b3f0c793763692d018a98
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3300
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3340
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736704
TryBot-Bypass: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>

7 days ago[release-branch.go1.26] all: merge master (6b2505c) into release-branch.go1.26
Junyang Shao [Thu, 8 Jan 2026 18:14:02 +0000 (18:14 +0000)]
[release-branch.go1.26] all: merge master (6b2505c) into release-branch.go1.26

Merge List:

+ 2026-01-08 6b2505c79c cmd/go: remove user-content from doc strings in cgo ASTs.
+ 2026-01-08 4b89bcb8b7 lib/fips140: freeze v1.26.0 FIPS 140-3 module
+ 2026-01-08 8ac4477d83 simd/archsimd: rename Broadcast methods
+ 2026-01-08 5facb3b24b internal/types: add test for cycles in value context
+ 2026-01-07 28147b5283 cmd/go: guarantee a minimum of min(4,GOMAXPROCS) to compile -c
+ 2026-01-07 874d8b98eb cmd/go/internal/work: decrement concurrentProcesses when action finishes
+ 2026-01-07 d1e7f49e3d internal/trace: fix recorder.Write return value for header-only buffers

Change-Id: I863375a1ac0f641b0b02968acf01a602b7d7f2a1

7 days agocmd/go: remove user-content from doc strings in cgo ASTs.
Neal Patel [Tue, 6 Jan 2026 21:09:19 +0000 (16:09 -0500)]
cmd/go: remove user-content from doc strings in cgo ASTs.

Thank you to RyotaK (https://ryotak.net) of GMO Flatt Security Inc. for reporting this issue.

Updates golang/go#76697
Fixes CVE-2025-61732

Change-Id: I1121502f1bf1e91309eb4bd41cc3a09c39366d36
Reviewed-on: https://go-review.googlesource.com/c/go/+/734220
Reviewed-by: Agustin Hernandez <garisol1982@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 days agolib/fips140: freeze v1.26.0 FIPS 140-3 module
Filippo Valsorda [Fri, 19 Dec 2025 22:14:36 +0000 (23:14 +0100)]
lib/fips140: freeze v1.26.0 FIPS 140-3 module

Fixes #76770

Change-Id: Ia617f01ea9be0d1759147b6cca0403c56a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/731840
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
7 days agosimd/archsimd: rename Broadcast methods
Cherry Mui [Thu, 8 Jan 2026 16:57:28 +0000 (11:57 -0500)]
simd/archsimd: rename Broadcast methods

Currently the Broadcast128/256/512 methods broadcast the lowest
element of the input vector to a vector of the corresponding width.
There are also variations of broadcast operations that broadcast
the whole (128- or 256-bit) vector to a larger vector, which we
don't yet support. Our current naming is unclear which version it
is, though. Rename the current ones to Broadcast1ToN, to be clear
that they broadcast one element. The vector version probably will
be named BoradcastAllToN (not included in this CL).

Change-Id: I47a21e367f948ec0b578d63706a40d20f5a9f46d
Reviewed-on: https://go-review.googlesource.com/c/go/+/734840
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
8 days agointernal/types: add test for cycles in value context
Mark Freeman [Wed, 7 Jan 2026 21:40:53 +0000 (16:40 -0500)]
internal/types: add test for cycles in value context

Exposition is also added to outline a difference between syntax which
can / cannot produce values of incomplete types.

For us to enforce non-nilness of type RHS and remove the pending type
mechanism, I suspect we would need to add completeness guards to
the syntax which *can*.

Enforcing non-nilness of type RHS currently breaks the below test
cases, but I suspect that is simply an implementation artifact.
In other words, they just call Underlying at a bad time.

  - T0
  - T3
  - T6 / T7
  - T10
  - T12

If we also remove pendingType, all of these test cases break; again,
we would need guards in the appropriate syntax logic.

Change-Id: Ibe22042232e542de1d38b923dd1d5cc50dce08cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/734600
TryBot-Bypass: Mark Freeman <markfreeman@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Mark Freeman <markfreeman@google.com>

8 days agocmd/go: guarantee a minimum of min(4,GOMAXPROCS) to compile -c
Michael Matloob [Mon, 5 Jan 2026 17:23:14 +0000 (12:23 -0500)]
cmd/go: guarantee a minimum of min(4,GOMAXPROCS) to compile -c

To allow this, we also increase the size of the pool to allow the
minimum number for each action, with an extra 2*GOMAXPROCS number of
tokens to boost -c when there are fewer concurrently running actions.
That means the pool will now have the size 6*GOMAXPROCS instead of the
previous 4*GOMAXPROCS.

The goal is to maintain the boosting behavior added by the pool, while
guarding from starving compiles when there are too few tokens left, so
that the value of -c is always at least min(4,GOMAXPROCS), which is what
it was set to before Go 1.26.

Cq-Include-Trybots: luci.golang.try:gotip-linux-arm64_c4as16-perf_vs_parent,gotip-linux-arm64_c4ah72-perf_vs_parent,gotip-linux-amd64_c3h88-perf_vs_parent,gotip-linux-amd64_c2s16-perf_vs_parent
Change-Id: I113a38584514a6c025d3d1bc727ff8d86a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/734040
Commit-Queue: Michael Matloob <matloob@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
8 days agocmd/go/internal/work: decrement concurrentProcesses when action finishes
Michael Matloob [Tue, 6 Jan 2026 22:18:48 +0000 (17:18 -0500)]
cmd/go/internal/work: decrement concurrentProcesses when action finishes

This fixes a bug where we only incremented concurrentProcesses but never
decremented it, causing us to run out of tokens and give all compiles
-c=1 after a point.

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64_c2s16-perf_vs_parent,gotip-linux-amd64_c3h88-perf_vs_parent,gotip-linux-arm64_c4ah72-perf_vs_parent,gotip-linux-arm64_c4as16-perf_vs_parent
Change-Id: I41f4c1edb77004cbc1772d6d672045946a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/734260
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
TryBot-Bypass: Michael Matloob <matloob@google.com>

8 days agointernal/trace: fix recorder.Write return value for header-only buffers
jjpinto [Tue, 6 Jan 2026 22:47:07 +0000 (22:47 +0000)]
internal/trace: fix recorder.Write return value for header-only buffers

Fix issue #77083

Change-Id: I9189d1e3a6efea8478224164e820f50c818abcd5
GitHub-Last-Rev: bb24cbda95f0b5b10aeae9a5ee8cbe215ba6d4eb
GitHub-Pull-Request: golang/go#77092
Reviewed-on: https://go-review.googlesource.com/c/go/+/734300
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Commit-Queue: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 days ago[release-branch.go1.26] all: merge master (f6ebd91) into release-branch.go1.26
Junyang Shao [Wed, 7 Jan 2026 20:06:48 +0000 (20:06 +0000)]
[release-branch.go1.26] all: merge master (f6ebd91) into release-branch.go1.26

Merge List:

+ 2026-01-07 f6ebd91129 all: update vendored x/tools
+ 2026-01-06 d1d0fc7a97 os/exec: avoid atomic.Bool for Cmd.startCalled
+ 2026-01-05 9b2e3b9a02 simd/archsimd: use V(P)MOVMSK for mask ToBits if possible
+ 2026-01-02 f8ee0f8475 cmd/go/testdata/vcstest/git: use git commands that work on older git versions
+ 2026-01-02 b094749bad test/codegen: codify bit related code generation for arm64
+ 2026-01-02 e84983fa40 cmd/compile: optimize SIMD IsNaN.Or(IsNaN)
+ 2026-01-02 8244b85677 simd/archsimd: add tests for IsNaN
+ 2026-01-02 13440fb518 simd/archsimd: make IsNaN unary
+ 2026-01-02 c3550b3352 simd/archsimd: correct documentation of Mask types
+ 2026-01-02 34ad26341d net/rpc: correct comment for isExportedOrBuiltinType function
+ 2025-12-30 b28808d838 cmd/go/internal/modindex: fix obvious bug using failed type assertion
+ 2025-12-30 d64add4d60 simd/archsimd: adjust documentations slightly
+ 2025-12-30 1843cfbcd6 runtime/secret: make tests more sturdy
+ 2025-12-30 fd45d70799 all: fix some minor grammatical issues in the comments
+ 2025-12-30 df4e08ac65 test/codegen: fix a tab in comparisons.go to ensure pattern works
+ 2025-12-30 cd668d744f cmd/compile: disable inlining for functions using runtime.deferrangefunc
+ 2025-12-29 06eff0f7c3 simd/archsimd: add tests for Saturate-Concat operations
+ 2025-12-29 110aaf7137 simd/archsimd: add tests for Saturate operations
+ 2025-12-29 22e7b94e7f simd/archsimd: add tests for ExtendLo operations
+ 2025-12-29 76dddce293 simd/archsimd: remove redundant suffix of ExtendLo operations
+ 2025-12-29 6ecdd2fc6e simd/archsimd: add more tests for Convert operations
+ 2025-12-29 e0c99fe285 simd/archsimd: add more tests for Truncate operations
+ 2025-12-29 08369369e5 reflect: document Call/CallSlice panic when v is unexported field
+ 2025-12-29 ca8effbde1 internal/coverage/decodemeta: correct wording in unknown version error
+ 2025-12-29 0b06b68e21 encoding/gob: clarify docs about pointers to zero values not being sent
+ 2025-12-29 9cb3edbfe9 regexp: standardize error message format in find_test.go
+ 2025-12-29 b3ed0627ce tests: improve consistency and clarity of test diagnostics
+ 2025-12-29 3dcb48d298 test: follow got/want convention in uintptrescapes test
+ 2025-12-29 f7b7e94b0a test: clarify log message for surrogate UTF-8 check
+ 2025-12-29 e790d59674 simd/archsimd: add tests for Truncate operations
+ 2025-12-27 f4cec7917c cmd: fix unused errors reported by ineffassign
+ 2025-12-27 ca13fe02c4 simd/archsimd: add more tests for Convert operations
+ 2025-12-27 037c047f2c simd/archsimd: add more tests for Extend operations
+ 2025-12-26 7971fcdf53 test/codegen: tidy tests for bits
+ 2025-12-24 0f620776d7 simd/archsimd: fix "go generate" command
+ 2025-12-24 a5fe8c07ae simd/archsimd: guard test helpers with amd64 tag
+ 2025-12-23 a23d1a4ebe bytes: improve consistency in split test messages
+ 2025-12-23 866e461b96 cmd/go: update pkgsite doc command to v0.0.0-20251223195805-1a3bd3c788fe
+ 2025-12-23 08dc8393d7 time: skip test that will fail with GO111MODULE=off
+ 2025-12-23 43ebed88cc runtime: improve a log message in TestCleanupLost
+ 2025-12-23 81283ad339 runtime: fix nGsyscallNoP accounting
+ 2025-12-23 3e0e1667f6 test/codegen: codify bit related code generation for riscv64
+ 2025-12-23 3faf988f21 errors: add a test verifying join does not flatten errors
+ 2025-12-23 2485a0bc2c cmd/asm/internal/asm: run riscv64 end-to-end tests for each profile
+ 2025-12-23 8254d66eab cmd/asm/internal/asm: abort end to end test if assembly failed
+ 2025-12-23 1b3db48db7 Revert "errors: optimize errors.Join for single unwrappable errors"
+ 2025-12-23 b6b8b2fe6e cmd/compile: handle propagating an out-of-range jump table index
+ 2025-12-22 2cd0371a0a debug/pe: avoid panic in File.ImportedSymbols
+ 2025-12-22 91435be153 runtime: revert entry point on freebsd/arm64
+ 2025-12-22 c1efada1d2 simd/archsimd: correct documentation for pairwise operations
+ 2025-12-22 3d77a0b15e os/exec: second call to Cmd.Start is always an error
+ 2025-12-20 7ecb1f36ac simd/archsimd: add HasAVX2() guards to tests that need them
+ 2025-12-19 70c22e0ad7 simd/archsimd: delete DotProductQuadruple methods for now
+ 2025-12-19 42cda7c1df simd/archsimd: add Grouped for 256- and 512-bit SaturateTo(U)Int16Concat, and fix type
+ 2025-12-19 baa0ae3aaa simd/archsimd: correct type and instruction for SaturateToUint8
+ 2025-12-19 d46c58debb go/doc: link to struct fields in the same package
+ 2025-12-19 25ed6c7f9b cmd/go/internal/doc: update pkgsite version
+ 2025-12-19 4411edf972 simd/archsimd: reword documentation for some operations
+ 2025-12-19 7d9418a19c simd/archsimd: reword documentation of comparison operations
+ 2025-12-18 d00e96d3ae internal/cpu: repair VNNI feature check
+ 2025-12-18 cfc024daeb simd/archsimd: reword documentation for conversion ops
+ 2025-12-17 ad91f5d241 simd/archsimd: reword documentation of shfit operations
+ 2025-12-17 b8c4cc63e7 runtime: keep track of secret allocation size
+ 2025-12-17 8564fede89 cmd/go: remove reference to no longer existing -i flag
+ 2025-12-17 eecdb61eeb crypto: rename fips140v2.0 to fips140v1.26
+ 2025-12-17 05e41225f6 simd/archsimd: reword documentation of As methods
+ 2025-12-17 516699848b runtime/secret: warn users about allocations, loosen guarantees
+ 2025-12-16 8c28ab936a cmd/cgo: don't emit C local if it is not used
+ 2025-12-16 65b71c11d4 crypto/internal/fips140only: test fips140=only mode
+ 2025-12-16 ea1aa76554 go/doc: exclude examples with results
+ 2025-12-16 5046bdf8a6 crypto/tls: reject trailing messages after client/server hello
+ 2025-12-16 3f6eabdf09 cmd/compile: use unsigned constant when folding loads for SIMD ops with constants
+ 2025-12-16 a4b5b92055 cmd/dist: preserve existing GOEXPERIMENTs when running tests with additional experiments

Change-Id: I84ad4ceba344761142b98587c07d186cf2d638ff

8 days agoall: update vendored x/tools
Dmitri Shuralyov [Fri, 2 Jan 2026 16:36:00 +0000 (11:36 -0500)]
all: update vendored x/tools

Pull in the following x/tools changes:

- CL 732260: go/analysis/passes/modernize: disable BLoop analyzer
- CL 733340: gopls/internal/analysis/modernize: mapsloop: undefined loop-var

For #74967.
For #77008.

[git-generate]
go install golang.org/x/build/cmd/updatestd@latest
go install golang.org/x/tools/cmd/bundle@latest
updatestd -goroot=$(pwd) -branch=internal-branch.go1.26-vendor

Change-Id: Ic0c10569a4a3a292aec9164e6dd034e55d052904
Reviewed-on: https://go-review.googlesource.com/c/go/+/733780
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
9 days agoos/exec: avoid atomic.Bool for Cmd.startCalled
Alan Donovan [Tue, 6 Jan 2026 19:48:31 +0000 (14:48 -0500)]
os/exec: avoid atomic.Bool for Cmd.startCalled

An atomic.Bool isn't necessary here since, unless otherwise
specified, the methods of an object are not concurrency-safe
w.r.t. each other. Using an atomic causes the copylocks vet
check to warn about copying of Cmd, which is not wrong, because
one shouldn't be copying opaque complex structs from other
packages, but it is a nuisance in the absence of any safe way
to copy a Cmd.

If and when we add a Clone method to Cmd (see #77075) then
it would be appropriate to revert this change so that we get
the benefit of the static check (though ideally we would make
a more explicit tool-readable declaration of the "do not copy"
attribute than merely happening to use an atomic.Bool).

For #77075

Change-Id: I982d4e86623ca165a3e76bbf648fd44041d5f6bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/734200
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

10 days agosimd/archsimd: use V(P)MOVMSK for mask ToBits if possible
Cherry Mui [Mon, 5 Jan 2026 17:56:08 +0000 (12:56 -0500)]
simd/archsimd: use V(P)MOVMSK for mask ToBits if possible

VPMOVMSKB, VMOVMSKPS, and VMOVMSKPD moves AVX1/2-style masks to
integer registers, similar to VPMOV[BWDQ]2M (which moves to mask
registers). The former is available on AVX1/2, the latter requires
AVX512. So use the former if it is supported, i.e. for 128- and
256-bit vectors with 8-, 32-, and 64-bit elements (16-bit elements
always require AVX512).

Change-Id: I972195116617ed2faaf95cee5cd6b250e671496c
Reviewed-on: https://go-review.googlesource.com/c/go/+/734060
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
13 days agocmd/go/testdata/vcstest/git: use git commands that work on older git versions
Joel Sing [Fri, 12 Dec 2025 08:03:05 +0000 (19:03 +1100)]
cmd/go/testdata/vcstest/git: use git commands that work on older git versions

On older versions of git (such as 2.25.1), `git branch -M master`
fails after `git init` - use `git checkout -b master` instead, which
works across multiple versions.

Fixes tests on the rather outdated linux/mips* builders.

Change-Id: Id86ec82b37a8d2c3131f449276b13989d097d106
Reviewed-on: https://go-review.googlesource.com/c/go/+/729600
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
13 days agotest/codegen: codify bit related code generation for arm64
Joel Sing [Wed, 24 Dec 2025 08:11:52 +0000 (19:11 +1100)]
test/codegen: codify bit related code generation for arm64

Also more consistently include commas after constants to increase
accuracy (i.e. "1," cannot inadvertantly match "10")

Change-Id: I480a73859d2e83354b8e9f94bc73c6563976d0e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/733460
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
13 days agocmd/compile: optimize SIMD IsNaN.Or(IsNaN)
Cherry Mui [Fri, 2 Jan 2026 19:02:07 +0000 (14:02 -0500)]
cmd/compile: optimize SIMD IsNaN.Or(IsNaN)

IsNaN's underlying instruction, VCMPPS (or VCMPPD), takes two
inputs, and computes either of them is NaN. Optimize the Or
pattern to generate two-operand form.

This implements the optimization mentioned in CL 733660.

Change-Id: I13943b377ee384864c913eed320763f333a03e41
Reviewed-on: https://go-review.googlesource.com/c/go/+/733680
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

13 days agosimd/archsimd: add tests for IsNaN
Cherry Mui [Wed, 31 Dec 2025 08:00:16 +0000 (03:00 -0500)]
simd/archsimd: add tests for IsNaN

Change-Id: I374ce84fd21c41a04e2d5964d8aa872545c6a8a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/733661
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
13 days agosimd/archsimd: make IsNaN unary
Cherry Mui [Wed, 31 Dec 2025 07:42:30 +0000 (02:42 -0500)]
simd/archsimd: make IsNaN unary

Currently, the IsNan API is defined as x.IsNan(y), which returns
a mask to represent, for each element, either x or y is NaN.
Albeit closer to the machine instruction, this is weird API, as
IsNaN is a unary operation. This CL changes it to unary, x.IsNaN().
It compiles to VCMPPS $3, x, x (or VCMPPD). For the two-operand
version, we can optimize x.IsNaN().Or(y.IsNaN()) to VCMPPS $3, x,
y (not done in this CL).

While here, change the name to IsNaN (uppercase both Ns), which
matches math.IsNaN.

Tests in the next CL.

Change-Id: Ib6e7afc2635e6c3c606db5ea16420ee673a6c6d6
Reviewed-on: https://go-review.googlesource.com/c/go/+/733660
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

13 days agosimd/archsimd: correct documentation of Mask types
Cherry Mui [Tue, 30 Dec 2025 22:08:25 +0000 (17:08 -0500)]
simd/archsimd: correct documentation of Mask types

The documentation of Mask types currently describe vector types,
not masks. Correct them.

Change-Id: Ib2723310842c6d10cfdd772c7abb8d4c1e63b130
Reviewed-on: https://go-review.googlesource.com/c/go/+/733342
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

13 days agonet/rpc: correct comment for isExportedOrBuiltinType function
jjpinto [Sat, 27 Dec 2025 15:18:07 +0000 (15:18 +0000)]
net/rpc: correct comment for isExportedOrBuiltinType function

Change to follow the idiomatic Go doc comment style

Change-Id: I727801903c8fc1a66c8a71ab5455f12219b469d5
GitHub-Last-Rev: dd608c9cb93d2f9d0358607fab6b58913b499709
GitHub-Pull-Request: golang/go#77015
Reviewed-on: https://go-review.googlesource.com/c/go/+/732902
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 weeks agocmd/go/internal/modindex: fix obvious bug using failed type assertion
Michael Matloob [Tue, 30 Dec 2025 20:41:41 +0000 (15:41 -0500)]
cmd/go/internal/modindex: fix obvious bug using failed type assertion

adonovan pointed out this bug in the review of CL 733320 and this seems
to be the cause of all those list_empty_importpath flakes. It makes
sense that something nondeterministic would be tied up with the module
index because the state of the cache could depend on the order tests are
run in.

Also remove the parts of the test that accept the flaky behavior so we
can verify the issue has been resolved.

For #73976

Change-Id: Ib64ce6b8eed1dc8d327b7c5e842c1e716a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/733321
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
2 weeks agosimd/archsimd: adjust documentations slightly
Cherry Mui [Fri, 19 Dec 2025 22:37:37 +0000 (17:37 -0500)]
simd/archsimd: adjust documentations slightly

- Reword the documentation of Scale to mention parameter names.
- Correct the parameter name in Merge.
- Use proper a/an articles in some documentation.
- Add punctuations.
- Format code blocks for long expressions.

Change-Id: I8a31721503c1b155862255619a835895f3d5123a
Reviewed-on: https://go-review.googlesource.com/c/go/+/731560
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

2 weeks agoruntime/secret: make tests more sturdy
Daniel Morsing [Sun, 28 Dec 2025 09:29:47 +0000 (09:29 +0000)]
runtime/secret: make tests more sturdy

Technically, the garbage collector can take an arbitrary long time until
it finds a given value unreachable. Account for this fact in our zeroing
tests.

Updates #76586.

Change-Id: Ieaf3cec99afb9204a32524ea559c5f1a280a59e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/732980
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

2 weeks agoall: fix some minor grammatical issues in the comments
cuishuang [Thu, 18 Dec 2025 02:36:50 +0000 (10:36 +0800)]
all: fix some minor grammatical issues in the comments

Change-Id: I0459f05e7f6abd9738813c65d993114e931720d5
Reviewed-on: https://go-review.googlesource.com/c/go/+/731000
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>

2 weeks agotest/codegen: fix a tab in comparisons.go to ensure pattern works
Alexander Musman [Sat, 6 Dec 2025 13:43:55 +0000 (21:43 +0800)]
test/codegen: fix a tab in comparisons.go to ensure pattern works

Fix a pattern in test/codegen/comparisons.go to use whitespace instead
of a tab. The test needs a whitespace to properly fail if the regalloc
change from CL686655 would be missing (in that case we would have a
spill immediately after call to memequal, which is supposed to be
captured by this pattern).

Change-Id: I5b6fb5e861b9327c7f071660592b8ffa265e0030
Reviewed-on: https://go-review.googlesource.com/c/go/+/727620
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2 weeks agocmd/compile: disable inlining for functions using runtime.deferrangefunc
zuojunwei.1024 [Tue, 23 Dec 2025 08:12:04 +0000 (16:12 +0800)]
cmd/compile: disable inlining for functions using runtime.deferrangefunc

The rangefunc rewrite pass implements defer using deferrangefunc and
deferproccat. The loop body is rewritten into a closure, it cannot be
inlined due to defer call. But the outer function may still be inlined
in certain scenarios (e.g., with PGO), leading to the defer executing
at the wrong time.

Fixes #77033

Change-Id: I4649fad5cd1b65891832523522002d9352711123
Reviewed-on: https://go-review.googlesource.com/c/go/+/732140
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 weeks agosimd/archsimd: add tests for Saturate-Concat operations
Cherry Mui [Mon, 29 Dec 2025 20:42:10 +0000 (15:42 -0500)]
simd/archsimd: add tests for Saturate-Concat operations

Change-Id: I9707b68e1ade9fd7c422cb34329edd648e4df7ab
Reviewed-on: https://go-review.googlesource.com/c/go/+/733160
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

2 weeks agosimd/archsimd: add tests for Saturate operations
Cherry Mui [Mon, 29 Dec 2025 19:56:53 +0000 (14:56 -0500)]
simd/archsimd: add tests for Saturate operations

Change-Id: Iea095112310802b29b4ef9ca6e559ea3c5aa83ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/733140
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2 weeks agosimd/archsimd: add tests for ExtendLo operations
Cherry Mui [Mon, 29 Dec 2025 17:41:57 +0000 (12:41 -0500)]
simd/archsimd: add tests for ExtendLo operations

Change-Id: I77a5f0dc58e068882a177dc32d162821b38f34ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/733101
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

2 weeks agosimd/archsimd: remove redundant suffix of ExtendLo operations
Cherry Mui [Mon, 29 Dec 2025 16:30:33 +0000 (11:30 -0500)]
simd/archsimd: remove redundant suffix of ExtendLo operations

For methods like ExtendLo2ToInt64x2, the last "x2" is redundant, as
it is already mentioned in "Lo2". Remove it, so it is just
ExtendLo2ToInt64.

Change-Id: I490afd818c40bb7a4ef15c249723895735bd6488
Reviewed-on: https://go-review.googlesource.com/c/go/+/733100
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2 weeks agosimd/archsimd: add more tests for Convert operations
Cherry Mui [Mon, 29 Dec 2025 15:51:50 +0000 (10:51 -0500)]
simd/archsimd: add more tests for Convert operations

Now include operations with input and output with different
lengths.

Change-Id: Idd5b88e67fa943a35a307e00e3348a20d79120a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/733060
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2 weeks agosimd/archsimd: add more tests for Truncate operations
Cherry Mui [Sat, 27 Dec 2025 19:21:37 +0000 (14:21 -0500)]
simd/archsimd: add more tests for Truncate operations

Now include operations with input and output with different
lengths.

Change-Id: I5c9759e31ffae2d621a13f9cb3f5dd64e87a1c44
Reviewed-on: https://go-review.googlesource.com/c/go/+/732920
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2 weeks agoreflect: document Call/CallSlice panic when v is unexported field
qiulaidongfeng [Sat, 26 Jul 2025 05:44:12 +0000 (13:44 +0800)]
reflect: document Call/CallSlice panic when v is unexported field

Fixes #74377

Change-Id: I250d67ef2a4bf4dac939be669eeaf1091523ac06
Reviewed-on: https://go-review.googlesource.com/c/go/+/690617
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 weeks agointernal/coverage/decodemeta: correct wording in unknown version error
jjpinto [Wed, 24 Dec 2025 17:39:35 +0000 (17:39 +0000)]
internal/coverage/decodemeta: correct wording in unknown version error

Correct the wording in the error message returned by readFileHeader when
encountering a meta-data file with an unsupported version.

Change-Id: I49be1bb1509ccc64e8384103bd7f19382b536c26
GitHub-Last-Rev: 2ab8e05a21443c45635e42d788946bec2478ca99
GitHub-Pull-Request: golang/go#76981
Reviewed-on: https://go-review.googlesource.com/c/go/+/732581
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@golang.org>
2 weeks agoencoding/gob: clarify docs about pointers to zero values not being sent
Oleg Zaytsev [Fri, 26 Dec 2025 20:11:01 +0000 (20:11 +0000)]
encoding/gob: clarify docs about pointers to zero values not being sent

The documentation on encoding/gob mentions that pointers are flattened,
and it also explicitly says that empty values are not sent.

A corollary of this, is that pointers to zero values are not sent, i.e.,
gob-encoding of *false becomes nil on the receiver side.

It is worth documenting this explicitly.

Change-Id: I1909203b8972e20791144bdda22e5f1b466aad97
GitHub-Last-Rev: 57764ec235ffe48484be98d3ed5269f0102ca4f8
GitHub-Pull-Request: golang/go#77009
Reviewed-on: https://go-review.googlesource.com/c/go/+/732820
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 weeks agoregexp: standardize error message format in find_test.go
jjpinto [Fri, 26 Dec 2025 17:13:09 +0000 (17:13 +0000)]
regexp: standardize error message format in find_test.go

This change updates the test error messages in find_test.go to follow
the Go standard 'got, want' format.

It also replaces 'expected/should be' terminology with the project's
preferred style and improves the clarity of failure logs by using %q
to quote string values.

Change-Id: I17bfc60a06a879ce5e2c64d624c636e2c24135e9
GitHub-Last-Rev: e9613ac28cdce2fc16672b4aa42636b01ae0a80c
GitHub-Pull-Request: golang/go#77005
Reviewed-on: https://go-review.googlesource.com/c/go/+/732780
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
2 weeks agotests: improve consistency and clarity of test diagnostics
jjpinto [Mon, 29 Dec 2025 19:39:04 +0000 (19:39 +0000)]
tests: improve consistency and clarity of test diagnostics

Minor updates to test diagnostics for consistency and readability:
- Corrected an incorrect identifier
- Standardized float formatting

No behavior changes.

Change-Id: I3d3633a7cc487209341ea92101f8c67848212080
GitHub-Last-Rev: b2822e846a91ce2563445f90f8d5768662a9babf
GitHub-Pull-Request: golang/go#77001
Reviewed-on: https://go-review.googlesource.com/c/go/+/732762
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2 weeks agotest: follow got/want convention in uintptrescapes test
jjpinto [Fri, 26 Dec 2025 14:57:02 +0000 (14:57 +0000)]
test: follow got/want convention in uintptrescapes test

Standardize the output messages in uintptrescapes.dir/main.go

Change-Id: I7965bb9829c7b55ac03cb8b46b333e6b65acf755
GitHub-Last-Rev: d254e0e30eac3a54bff4581f75a01587be029b15
GitHub-Pull-Request: golang/go#77000
Reviewed-on: https://go-review.googlesource.com/c/go/+/732761
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

2 weeks agotest: clarify log message for surrogate UTF-8 check
jjpinto [Fri, 26 Dec 2025 14:39:48 +0000 (14:39 +0000)]
test: clarify log message for surrogate UTF-8 check

The current log message "does not error" is slightly ambiguous.
This change clarifies the output.

Change-Id: I5c2327b9fa3d3e28ce43ce1189f8b1b7663fe0d3
GitHub-Last-Rev: bb2b03fc909f0bae29ab540776ae1d28165a603a
GitHub-Pull-Request: golang/go#76998
Reviewed-on: https://go-review.googlesource.com/c/go/+/732740
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 weeks agosimd/archsimd: add tests for Truncate operations
Cherry Mui [Sat, 27 Dec 2025 04:18:37 +0000 (23:18 -0500)]
simd/archsimd: add tests for Truncate operations

For now, only include operations that input and output vectors
have the same number of elements.

Change-Id: I933c800ace515d8d51834d20c134090470950042
Reviewed-on: https://go-review.googlesource.com/c/go/+/732860
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: David Chase <drchase@google.com>

2 weeks agocmd: fix unused errors reported by ineffassign
Lin Lin [Thu, 18 Dec 2025 05:05:26 +0000 (13:05 +0800)]
cmd: fix unused errors reported by ineffassign

Updates golang/go#35136

Change-Id: I36d26089d29933e363d9fa50f3174530b698450e
Reviewed-on: https://go-review.googlesource.com/c/go/+/731040
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 weeks agosimd/archsimd: add more tests for Convert operations
Cherry Mui [Fri, 26 Dec 2025 21:38:56 +0000 (16:38 -0500)]
simd/archsimd: add more tests for Convert operations

For now, only include operations that input and output vectors
have the same number of elements.

Change-Id: If4722f1b0168eaf0e333bdcd218e394fa4ab440f
Reviewed-on: https://go-review.googlesource.com/c/go/+/732662
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

2 weeks agosimd/archsimd: add more tests for Extend operations
Cherry Mui [Fri, 26 Dec 2025 16:53:19 +0000 (11:53 -0500)]
simd/archsimd: add more tests for Extend operations

The operations that extend only low elements, ExtendLoNTo..., are
not yet included.

Change-Id: I93168889b92c56720344b443c1cff238f8cc096a
Reviewed-on: https://go-review.googlesource.com/c/go/+/732661
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

3 weeks agotest/codegen: tidy tests for bits
Joel Sing [Tue, 23 Dec 2025 12:43:15 +0000 (23:43 +1100)]
test/codegen: tidy tests for bits

Use Go idiomatic function names, use a common prefix, attempt to
maintain some consistency, avoid naming functions based upon
machine specific instructions and combine a duplicate test that
likely exists due to this confusion.

Change-Id: I996e9efd7497821edef94c1997d4a310d9d79a71
Reviewed-on: https://go-review.googlesource.com/c/go/+/732200
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Joel Sing <joel@sing.id.au>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
3 weeks agosimd/archsimd: fix "go generate" command
Cherry Mui [Tue, 23 Dec 2025 16:31:36 +0000 (11:31 -0500)]
simd/archsimd: fix "go generate" command

Correct the generate command for test helpers. There is no longer
a genfiles.go. Also correct the generated file headers to match
the current generator layout.

Change-Id: Ifb9a8c394477359020ff44290dbaabe7a2d59aca
Reviewed-on: https://go-review.googlesource.com/c/go/+/732280
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: David Chase <drchase@google.com>

3 weeks agosimd/archsimd: guard test helpers with amd64 tag
Cherry Mui [Tue, 23 Dec 2025 18:25:36 +0000 (13:25 -0500)]
simd/archsimd: guard test helpers with amd64 tag

The test helpers load vectors. Currently the load functions are
only available on AMD64, so guard them with the tag. Now

GOEXPERIMENT=simd go test simd/...

doesn't fail on a non-AMD64 machine.

Change-Id: Ie75f1fbb3b91629bc477b3140630bc47a4ef5b63
Reviewed-on: https://go-review.googlesource.com/c/go/+/732380
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
3 weeks agobytes: improve consistency in split test messages
jjpinto [Tue, 23 Dec 2025 18:11:53 +0000 (18:11 +0000)]
bytes: improve consistency in split test messages

This change improves consistency in the error messages used by TestSplit and TestSplitAfter in bytes_test.go

Change-Id: Idc4e77a516037ce17cbb1bdffe3ac00bcde5de42
GitHub-Last-Rev: 8c4a35186851004251e8eee71c88ca1c822851c1
GitHub-Pull-Request: golang/go#76970
Reviewed-on: https://go-review.googlesource.com/c/go/+/732300
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>

3 weeks agocmd/go: update pkgsite doc command to v0.0.0-20251223195805-1a3bd3c788fe
Michael Matloob [Tue, 23 Dec 2025 20:45:41 +0000 (15:45 -0500)]
cmd/go: update pkgsite doc command to v0.0.0-20251223195805-1a3bd3c788fe

This pulls in a version of the pkgsite doc command that includes CL
729900 which adds support for showing documentation for some of our
experiments

Change-Id: I52aebf06521adc114aa90f99f515f2746a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/732400
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
3 weeks agotime: skip test that will fail with GO111MODULE=off
Kevin Burke [Tue, 23 Dec 2025 06:07:32 +0000 (22:07 -0800)]
time: skip test that will fail with GO111MODULE=off

The test is designed to ensure that behavior introduced in Go 1.23
to garbage collect async timed channels is working correctly. If
GO111MODULE=off is set (or GODEBUG=asynctimerchan=1) Go reverts to the
Go 1.20 behavior of not garbage collecting these channels, which fails
the test.

Instead of running a test in conditions where we know it will fail,
just skip the test. A more comprehensive test does not make sense
right now because this code may go away soon.

Fixes #76948.

Change-Id: Ib186abd2ea583a06b5c246bfd6df932522cf7f1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/732100
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

3 weeks agoruntime: improve a log message in TestCleanupLost
Lin Lin [Sat, 20 Dec 2025 15:46:30 +0000 (23:46 +0800)]
runtime: improve a log message in TestCleanupLost

Updates #76929

Change-Id: I3951b14ec979b389773f782a0a89f8277c7b9a59
Reviewed-on: https://go-review.googlesource.com/c/go/+/731680
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

3 weeks agoruntime: fix nGsyscallNoP accounting
Michael Anthony Knyszek [Tue, 23 Dec 2025 17:16:17 +0000 (17:16 +0000)]
runtime: fix nGsyscallNoP accounting

CL 726964 has two bugs.

One is fairly obvious. Where there was previous a decrement of
nGsyscallNoP in exitsyscallTryGetP, it added a call to addGSyscallNoP.
Oops.

The other is more subtle. In needm we set isExtraInC to false very
early. This will cause exitsyscall (via cgocallbackg) to decrement
nGsyscallNoP when the thread never had a corresponding increment. (It
could not have, otherwise it would not have called needm, on Linux
anyway.) The fix is simple: increment nGsyscallNoP. CL 726964 actually
removed this increment erroneously. I'm pretty sure I removed it because
the first bug was the real issue, and removing this increment "fixed it"
in the context of the test. I was right that this case was subtle, but
wrong about how.

Fixes #76435.

Change-Id: I1ff1dfbf43bd4cf536b0965da370fee58e3f8753
Reviewed-on: https://go-review.googlesource.com/c/go/+/732320
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

3 weeks agotest/codegen: codify bit related code generation for riscv64
Joel Sing [Tue, 23 Dec 2025 10:06:49 +0000 (21:06 +1100)]
test/codegen: codify bit related code generation for riscv64

Change-Id: Iba4d3ded15d578e97a978780069e70a51a5e944b
Reviewed-on: https://go-review.googlesource.com/c/go/+/732180
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Joel Sing <joel@sing.id.au>

3 weeks agoerrors: add a test verifying join does not flatten errors
Damien Neil [Tue, 23 Dec 2025 17:42:37 +0000 (09:42 -0800)]
errors: add a test verifying join does not flatten errors

For #76961

Change-Id: Ib81f3202074bf83a5b204b32706445f051f837a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/732360
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
3 weeks agocmd/asm/internal/asm: run riscv64 end-to-end tests for each profile
Joel Sing [Sun, 21 Dec 2025 03:48:18 +0000 (14:48 +1100)]
cmd/asm/internal/asm: run riscv64 end-to-end tests for each profile

Currently, the end-to-end tests are only run for the profile set
via GORISCV64. Run each of the end-to-end tests for each profile,
increasing test coverage. Also rename tests to be RISCV64 specific,
rather than RISCV.

Change-Id: I15a70939064122c79ec5f2edcda1fa2a47c8cc95
Reviewed-on: https://go-review.googlesource.com/c/go/+/731921
Auto-Submit: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
3 weeks agocmd/asm/internal/asm: abort end to end test if assembly failed
Joel Sing [Sun, 21 Dec 2025 03:39:20 +0000 (14:39 +1100)]
cmd/asm/internal/asm: abort end to end test if assembly failed

If errors are encountered during assembly, do not attempt to perform verification.
In this case the output is unlikely to be correct and all verification fails, which
means the real issue gets lost in the noise.

Change-Id: I62c1bf09fa025b0df4c06f0bfa424fb5d328184b
Reviewed-on: https://go-review.googlesource.com/c/go/+/731920
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Joel Sing <joel@sing.id.au>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
3 weeks agoRevert "errors: optimize errors.Join for single unwrappable errors"
Damien Neil [Tue, 23 Dec 2025 00:35:42 +0000 (16:35 -0800)]
Revert "errors: optimize errors.Join for single unwrappable errors"

This reverts CL 635115.

Reason for revert: The new behavior does not match the function documentation.

Fixes #76961

Change-Id: If2450aa4efba28c7a12887a5b306c231a836e740
Reviewed-on: https://go-review.googlesource.com/c/go/+/731981
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

3 weeks agocmd/compile: handle propagating an out-of-range jump table index
Cuong Manh Le [Mon, 22 Dec 2025 11:49:17 +0000 (18:49 +0700)]
cmd/compile: handle propagating an out-of-range jump table index

For an out-of-range jump table index, the constant facts should not be
propagated to the destinations.

Fixes #76950

Change-Id: Iff29814cb466c7aaa432cec212e5387665c45afc
Reviewed-on: https://go-review.googlesource.com/c/go/+/731860
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

3 weeks agodebug/pe: avoid panic in File.ImportedSymbols
Alex Brainman [Tue, 24 Jun 2025 05:18:28 +0000 (15:18 +1000)]
debug/pe: avoid panic in File.ImportedSymbols

This change skips symbols where dt.OriginalFirstThunk is less than
ds.VirtualAddress.

The variable types are uint32, and
(dt.OriginalFirstThunk-ds.VirtualAddress) becomes very large number when
dt.OriginalFirstThunk < ds.VirtualAddress.

Fixes #73548.
Fixes #76721.
Fixes #76724.

Change-Id: I72908bd0896003423aeb754fa0b6c72d452cdb4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/684495
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
3 weeks agoruntime: revert entry point on freebsd/arm64
Rob Nichols [Mon, 22 Dec 2025 21:25:08 +0000 (21:25 +0000)]
runtime: revert entry point on freebsd/arm64

CL 706175 unified some arm64 entry points. However, the entry point for
freebsd/arm64 is incorrect and builds now fail. This change reverts the
freebsd/arm64 entry point and adds additional context for the future.

Fixes #76958

Change-Id: Ib9e9b7844706f7b0ef54bd449411fefc8f10bc43
GitHub-Last-Rev: 70064d8126f8ff7e2c0e5e8d4b00177c627f4d76
GitHub-Pull-Request: golang/go#76959
Reviewed-on: https://go-review.googlesource.com/c/go/+/731980
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

3 weeks agosimd/archsimd: correct documentation for pairwise operations
Cherry Mui [Mon, 22 Dec 2025 19:52:57 +0000 (14:52 -0500)]
simd/archsimd: correct documentation for pairwise operations

For Add/SubPairs(Saturated?), the documented result element order
is wrong. Corrected.

Also, for 256-bit vectors, this is a grouped operation. So name it
with the Grouped suffix to be clear.

Change-Id: Idfd0975cb4a332b2e28c898613861205d26f75b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/732020
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
3 weeks agoos/exec: second call to Cmd.Start is always an error
Alan Donovan [Tue, 9 Dec 2025 15:06:23 +0000 (10:06 -0500)]
os/exec: second call to Cmd.Start is always an error

Previously it would return an error only if the first call
resulted in process creation, contra the intent of the
comment at exec.Cmd:

// A Cmd cannot be reused after calling its [Cmd.Start], [Cmd.Run],
// [Cmd.Output], or [Cmd.CombinedOutput] methods.

Also, clear the Cmd.goroutines slice in case of failure to
start a process, so that the closures can be GC'd and their
pipe fds finalized and closed.

Fixes #76746

Change-Id: Ic63a4dced0aa52c2d4be7d44f6dcfc84ee22282c
Reviewed-on: https://go-review.googlesource.com/c/go/+/728642
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
3 weeks agosimd/archsimd: add HasAVX2() guards to tests that need them
David Chase [Fri, 19 Dec 2025 20:50:57 +0000 (15:50 -0500)]
simd/archsimd: add HasAVX2() guards to tests that need them

This may not be complete, because some 256-bit float operations
may be implemented with integer simd instead (in some cases there
is no float op).  (And some tests may have just been overlooked.)

Fixes #76866.

Change-Id: I90b1dfe039c322c484af916436fc6f6c50a31030
Reviewed-on: https://go-review.googlesource.com/c/go/+/731502
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
3 weeks agosimd/archsimd: delete DotProductQuadruple methods for now
Cherry Mui [Fri, 19 Dec 2025 22:05:03 +0000 (17:05 -0500)]
simd/archsimd: delete DotProductQuadruple methods for now

The DotProductQuadruple methods are currently defined on Int8
vectors. There are some problems for that.

1. We defined a DotProductQuadrupleSaturated method, but the dot
product part does not need saturation, as it cannot overflow. It
is the addition part of VPDPBUSDS that does the saturation.
Currently we have optimization rules like

x.DotProductQuadrupleSaturated(y).Add(z) -> VPDPBUSDS

which is incorrect, in that the dot product doesn't do (or need)
saturation, and the Add is a regular Add, but we rewrite it to a
saturated add. The correct rule should be something like

x.DotProductQuadruple(y).AddSaturated(z) -> VPDPBUSDS

2. There are multiple flavors of DotProductQuadruple:
signed/unsigned Ã— signed/unsigned, which cannot be completely
disambiguated by the type. The current naming may preclude adding
all the flavors.

For these reasons, remove the methods for now. We can add them
later with the issues addressed.

Change-Id: I549c0925afaa68c7e2cc956105619f2c1b46b325
Reviewed-on: https://go-review.googlesource.com/c/go/+/731441
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
3 weeks agosimd/archsimd: add Grouped for 256- and 512-bit SaturateTo(U)Int16Concat, and fix...
Cherry Mui [Fri, 19 Dec 2025 20:21:15 +0000 (15:21 -0500)]
simd/archsimd: add Grouped for 256- and 512-bit SaturateTo(U)Int16Concat, and fix type

They operate on 128-bit groups, so name them Grouped to be clear,
and consistent with other grouped operations. Reword the
documentation, mention the grouping only for grouped versions.

Also, SaturateToUnt16Concat(Grouped) is a signed int32 to unsigned
uint16 saturated conversion. The receiver and the parameter should
be signed. The result remains unsigned.

Change-Id: I30e28bc05e07f5c28214c9c6d9d201cbbb183468
Reviewed-on: https://go-review.googlesource.com/c/go/+/731501
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

3 weeks agosimd/archsimd: correct type and instruction for SaturateToUint8
Cherry Mui [Fri, 19 Dec 2025 19:48:59 +0000 (14:48 -0500)]
simd/archsimd: correct type and instruction for SaturateToUint8

It should be defined on unsigned types, not signed types, and use
unsigned conversion instructions.

Change-Id: I49694ccdf1d331cfde88591531c358d9886e83e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/731500
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
3 weeks agogo/doc: link to struct fields in the same package
Sean Liao [Sun, 14 Dec 2025 18:48:51 +0000 (18:48 +0000)]
go/doc: link to struct fields in the same package

This collects up any struct direct field references
for linking. It does not attempt to do any validation
of embedded field conflicts as in CL 510315.

For #61394

Change-Id: I57dc0a0e8a71ce0bcb4e6c0963f459f76a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/729980
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
3 weeks agocmd/go/internal/doc: update pkgsite version
matloob [Fri, 19 Dec 2025 18:00:33 +0000 (13:00 -0500)]
cmd/go/internal/doc: update pkgsite version

Fixes #76827
For #36905

Change-Id: I3f855a75efc9272105f0a352c54600cd6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/731460
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
3 weeks agosimd/archsimd: reword documentation for some operations
Cherry Mui [Wed, 17 Dec 2025 16:20:25 +0000 (11:20 -0500)]
simd/archsimd: reword documentation for some operations

- Min/Max: make it clear it is elementwise.
- RoundToEven: clarify it is rounding tie to even.
- MulEvenWiden: use mathematical form of the index.
- CopySign: use parameter names directly.
- ConcatShiftBytesRight: rename the parameter.

Change-Id: I4cf0773c4daf3e3bf7b26e79d84ac5c2a9145c88
Reviewed-on: https://go-review.googlesource.com/c/go/+/731421
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

3 weeks agosimd/archsimd: reword documentation of comparison operations
Cherry Mui [Thu, 18 Dec 2025 04:21:00 +0000 (23:21 -0500)]
simd/archsimd: reword documentation of comparison operations

The wording for the emulated ones are more precise. Use that
everywhere.

Change-Id: Iab64e0bb1fb6b19178ebf30ba8e82360b5882fd3
Reviewed-on: https://go-review.googlesource.com/c/go/+/731420
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

4 weeks agointernal/cpu: repair VNNI feature check
David Chase [Thu, 18 Dec 2025 18:18:14 +0000 (13:18 -0500)]
internal/cpu: repair VNNI feature check

This is a pain to test.
Also the original test was never executed, because it was wrong.

It looks like processors that might lack this features
include Intel 11th generation and AMD Zen 4.  These might
or might not have bit 2 set in the 7th cpuid "leaf" (SM4)
which is what the incorrect test was checking; the bug
is triggered by ^VNNI & SM4.  Apparently the SM4 bit is
not usually set, else we would have seen a test failure.

The "Lion Cove" microarchitecture (Arrow Lake, Lunar Lake)
appears to trigger this problem, it's not clear if there are
others.  It was hard to verify this from online information.

Fixes #76881.

Change-Id: I21be6b4f47134d81e89799b0f06f89fcb6563264
Reviewed-on: https://go-review.googlesource.com/c/go/+/731240
TryBot-Bypass: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
4 weeks agosimd/archsimd: reword documentation for conversion ops
Cherry Mui [Wed, 17 Dec 2025 19:32:55 +0000 (14:32 -0500)]
simd/archsimd: reword documentation for conversion ops

Use more compact wording for extension, truncation, and
saturation. Say that we pack the results to the low elements and
zero the high elements if and only if the result has more elements.

Change-Id: Iae98d3c6ea6b5b5fa0acd548471e8d6c70a26d2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/730940
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
4 weeks agosimd/archsimd: reword documentation of shfit operations
Cherry Mui [Wed, 17 Dec 2025 16:00:36 +0000 (11:00 -0500)]
simd/archsimd: reword documentation of shfit operations

Say the name of the parameter, instead of "the immediate".

Don't say "Emptied bits are zeroed", which is implied by the shift
operation in Go (and perhaps many other languages). For right
shifts, say signed or unsigned shifts instead.

Change-Id: I29c9c0e218bfaeef55b03d92d44762e34f006654
Reviewed-on: https://go-review.googlesource.com/c/go/+/730720
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

4 weeks agoruntime: keep track of secret allocation size
Daniel Morsing [Tue, 16 Dec 2025 13:50:57 +0000 (13:50 +0000)]
runtime: keep track of secret allocation size

During a naive attempt to test the new runtime/secret package, I tried
wrapping the entire handshake in a secret.Do call. This lead to a panic
because some of the allocator logic had been previously untested.

freeSpecial takes p and size, but they can be misleading. They don't
refer to the pointer and size of the object with the special attached,
but a pointer to the enclosing object and the size of the span element.

The previous code did not take this into account and when passing the
size to memclr would overwrite nearby objects.

Fix by storing the size of the object being cleared inside the special.

Fixes #76865.

Change-Id: Ifae31f1c8d0609a562a37f37c45aec2f369dc6a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/730361
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
4 weeks agocmd/go: remove reference to no longer existing -i flag
matloob [Wed, 17 Dec 2025 16:30:52 +0000 (11:30 -0500)]
cmd/go: remove reference to no longer existing -i flag

The flag was removed in CL 416094.

Fixes #76850

Change-Id: Ia219b4d2d8391f08487b4ff1bbec43766a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/730721
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
4 weeks agocrypto: rename fips140v2.0 to fips140v1.26
Filippo Valsorda [Wed, 17 Dec 2025 16:50:07 +0000 (17:50 +0100)]
crypto: rename fips140v2.0 to fips140v1.26

Turns out we can't use non-v1 versions for the FIPS 140-3 module, so we
decided to match the versioning of the Go release the module is frozen
from.

Change-Id: Ib5c13511a51f9930fcde86cd7e8bd39c6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/730740
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
4 weeks agosimd/archsimd: reword documentation of As methods
Cherry Mui [Wed, 17 Dec 2025 04:14:43 +0000 (23:14 -0500)]
simd/archsimd: reword documentation of As methods

Change-Id: Ifd6d3e5386383908435dd622e280edb6aa13fdab
Reviewed-on: https://go-review.googlesource.com/c/go/+/730660
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
4 weeks agoruntime/secret: warn users about allocations, loosen guarantees
Daniel Morsing [Wed, 10 Dec 2025 10:13:05 +0000 (10:13 +0000)]
runtime/secret: warn users about allocations, loosen guarantees

The discussion at #76477 warranted some stronger documentation about
what is expected from users of the secret package. In addition, #76764
presented a problem about when a user can expect their secrets to be
deleted.

Fix by loosening the guarantee to when all allocations from within a
secret function have been deemed unreachable. Provide some guidance for
users to steer them away from situations where allocations live on for
long after the secret function has finished executing

Fixes #76764.
Updates #76477.

Change-Id: I0cef3e7275737f32ec48f71355e588b3be26ea32
Reviewed-on: https://go-review.googlesource.com/c/go/+/728921
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
4 weeks agocmd/cgo: don't emit C local if it is not used
Ian Lance Taylor [Wed, 17 Dec 2025 00:00:36 +0000 (16:00 -0800)]
cmd/cgo: don't emit C local if it is not used

Fixes #76861

Change-Id: Icc8452e48ed736e8240f8afea18637c33b8e3ef8
Reviewed-on: https://go-review.googlesource.com/c/go/+/730600
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Joe Richey <joerichey@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>

4 weeks agocrypto/internal/fips140only: test fips140=only mode
Filippo Valsorda [Sat, 28 Dec 2024 21:32:59 +0000 (22:32 +0100)]
crypto/internal/fips140only: test fips140=only mode

Fixes #70514
Updates #70878

Change-Id: I6a6a46561d872c8f7e9ea333ff208064b0bd44c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/728506
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
4 weeks agogo/doc: exclude examples with results
Sean Liao [Sun, 14 Dec 2025 20:02:33 +0000 (20:02 +0000)]
go/doc: exclude examples with results

Fixes #36185

Change-Id: I7634744e62e00023367ed48a4700b61a6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/729902
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
4 weeks ago[release-branch.go1.26] go1.26rc1 go1.26rc1
Gopher Robot [Tue, 16 Dec 2025 19:52:36 +0000 (11:52 -0800)]
[release-branch.go1.26] go1.26rc1

Change-Id: I28020794bf3595d31b0e64b692492a8ac951202a
Reviewed-on: https://go-review.googlesource.com/c/go/+/730501
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Bypass: Gopher Robot <gobot@golang.org>

4 weeks agocrypto/tls: reject trailing messages after client/server hello
Roland Shoemaker [Mon, 24 Nov 2025 22:03:10 +0000 (14:03 -0800)]
crypto/tls: reject trailing messages after client/server hello

For TLS 1.3, after procesesing the server/client hello, if there isn't a
CCS message, reject the trailing messages which were appended to the
hello messages. This prevents an on-path attacker from injecting
plaintext messages into the handshake.

Additionally, check that we don't have any buffered messages before we
switch the read traffic secret regardless, since any buffered messages
would have been under an old key which is no longer appropriate.

We also invert the ordering of setting the read/write secrets so that if
we fail when changing the read secret we send the alert using the
correct write secret.

Fixes #76443
Fixes CVE-2025-61730

Change-Id: If6ba8ad16f48d5cd5db5574824062ad4244a5b52
Reviewed-on: https://go-review.googlesource.com/c/go/+/724120
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Coia Prant <coiaprant@gmail.com>
4 weeks agocmd/compile: use unsigned constant when folding loads for SIMD ops with constants
Cherry Mui [Tue, 16 Dec 2025 16:16:47 +0000 (11:16 -0500)]
cmd/compile: use unsigned constant when folding loads for SIMD ops with constants

When folding loads into a SIMD op with a constant, in the SSA
rules we use makeValAndOff to create an AuxInt for the constant
and the offset. For the SIMD ops of concern (for now), the
constants are always unsigned. So pass the constant unsigned.

Fixes #76756.

Change-Id: Ia5910e689ff510ce54d3a0c2ed0e950bc54f8862
Reviewed-on: https://go-review.googlesource.com/c/go/+/730420
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

4 weeks agocmd/dist: preserve existing GOEXPERIMENTs when running tests with additional experiments
qmuntal [Tue, 16 Dec 2025 10:08:35 +0000 (11:08 +0100)]
cmd/dist: preserve existing GOEXPERIMENTs when running tests with additional experiments

Some tests require enabling specific Go experiments via the GOEXPERIMENT
, like "jsonv2", "runtimesecret", or "simd".

When running these tests, we should preserve any existing GOEXPERIMENT
settings, so that multiple experiments can be tested together.

I've found this limitation while working in my own Go fork, where in
some situations I pass additional experiments to the tests that alter
the Go runtime and other core packages.

Change-Id: Ib0324cd93282f6993611dea2f0c57d00ab304a33
Reviewed-on: https://go-review.googlesource.com/c/go/+/730360
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
4 weeks ago[release-branch.go1.26] all: merge master (d14b642) into release-branch.go1.26
Michael Anthony Knyszek [Mon, 15 Dec 2025 21:42:49 +0000 (21:42 +0000)]
[release-branch.go1.26] all: merge master (d14b642) into release-branch.go1.26

Merge List:

+ 2025-12-15 d14b6427cf cmd/link: set canUsePlugins only on platforms that support plugin
+ 2025-12-15 9ba0948172 cmd/link: don't create __x86.get_pc_thunk symbol if it already exists
+ 2025-12-15 b7944a5f80 text/template: fix slice builtin for pointers to arrays
+ 2025-12-15 6713f46426 archive/tar, compress/bzip2: base64 some troublesome testdata files
+ 2025-12-15 388eb10f50 cmd/go: show comparable in go doc interface output
+ 2025-12-13 1b291b70df simd/archsimd: skip tests if AVX is not available
+ 2025-12-12 d30884ba1f cmd/dist: test GOEXPERIMENT=simd on AMD64
+ 2025-12-12 ee0275d15b runtime, cmd/link: tighten search for stackObjectRecord
+ 2025-12-12 63fced531c runtime/secret: restore goroutine behavior to proposal
+ 2025-12-12 6455afbc6f runtime: dropg after emitting trace event in preemptPark
+ 2025-12-12 8f45611e78 runtime/pprof: deflake TestGoroutineLeakProfileConcurrency
+ 2025-12-12 34af879dde cmd/link: add new linknames to blocked linkname list
+ 2025-12-12 8d31244562 runtime/secret: guard files with goexperiment
+ 2025-12-12 e8a83788a4 go/doc: reuse import name logic for examples
+ 2025-12-11 927c89bbc5 cmd/compile: update ABI document for riscv64
+ 2025-12-11 245bcdd478 runtime: add extra subtest layer to TestFinalizerOrCleanupDeadlock
+ 2025-12-11 ae62a1bd36 Revert "database/sql: allow drivers to override Scan behavior"
+ 2025-12-11 89614ad264 runtime/trace: fix broken TestSubscribers
+ 2025-12-11 bb2337f24c cmd/go: set GOOS in vet_asm test
+ 2025-12-11 2622d2955b go/types, types2: remove indirection of Named.finite
+ 2025-12-11 5818c9d714 encoding/json/jsontext: add symbolic Kind constants
+ 2025-12-11 9de6468701 json/jsontext: normalize all invalid Kinds to 0
+ 2025-12-11 00642ee23b encoding/json: report true from v2 Decoder.More when an error is pending
+ 2025-12-11 7b60d06739 lib/time: update to 2025c/2025c
+ 2025-12-11 1de9585be2 runtime: prevent calls to GOMAXPROCS while clearing P trace state
+ 2025-12-11 e38c38f0e5 internal/trace: correctly handle GoUndetermined for GoroutineSummary
+ 2025-12-11 c0ba519764 simd/archsimd: rename Mask.AsIntMxN to Mask.ToIntMxN
+ 2025-12-11 f110ba540c simd/archsimd: define ToMask only on integer vectors
+ 2025-12-11 1da0c29c2a simd/archsimd: add package doc
+ 2025-12-11 f105dfd048 lib/fips140: freeze v1.1.0-rc1 FIPS 140 module zip file
+ 2025-12-11 af14f67911 runtime: make goroutines inherit DIT state, don't lock to OS thread
+ 2025-12-11 72c83bcc80 go/types, types2: put Named.finite behind Named.mu
+ 2025-12-10 b2a697bd06 all: update to x/crypto@7dacc380ba00
+ 2025-12-10 fc66a5655b crypto: clean up subprocess-spawning tests
+ 2025-12-10 b130dab792 crypto/hpke: apply fips140.WithoutEnforcement to ML-KEM+X25519 hybrid
+ 2025-12-10 c39fe18fea crypto/mlkem/mlkemtest: error out in fips140=only mode
+ 2025-12-10 db0ab834d6 crypto/hpke: don't corrupt enc's excess capacity in DHKEM decap
+ 2025-12-10 cd873cf7e9 crypto/internal/fips140/aes/gcm: don't panic on bad nonces out of FIPS 140-3 mode
+ 2025-12-10 550c0c898b crypto/hpke: use new gcm.NewGCMForHPKE for FIPS 140-3 compliance
+ 2025-12-10 d349854de6 crypto/internal: ACVP test data migrated to Geomys repo
+ 2025-12-10 cd9319ff8e runtime: use correct function name in methodValueCallFrameObjs comment
+ 2025-12-10 0d71bd57c9 runtime: VZEROUPPER at the end of FilterNilAVX512
+ 2025-12-09 36bca3166e cmd: fix some issues in the comments
+ 2025-12-09 b9693a2d9a runtime: on AIX check isarchive before calling libpreinit
+ 2025-12-09 1274d58dac go/types, types2: add check for finite size at value observance
+ 2025-12-08 9e09812308 all: REVERSE MERGE dev.simd (c456ab7) into master
+ 2025-12-08 c456ab7a30 [dev.simd] all: merge master (a33bbf1) into dev.simd
+ 2025-12-08 1d8711e126 [dev.simd] internal/buildcfg: don't enable SIMD experiment by default
+ 2025-12-08 a33bbf1988 weak: fix weak pointer test to correctly iterate over weak pointers after GC
+ 2025-12-08 a88a96330f cmd/cgo: use doc link for cgo.Handle
+ 2025-12-08 276cc4d3db cmd/link: fix AIX builds after recent linker changes
+ 2025-12-08 f38e968aba [dev.simd] cmd/compile: zero only low 128-bit of X15
+ 2025-12-08 144cf17d2c [dev.simd] simd, cmd/compile: move "simd" to "simd/archsimd"
+ 2025-12-08 f2d96272cb runtime/trace: update TestSubscribers to dump traces
+ 2025-12-08 4837bcc92c internal/trace: skip tests for alloc/free experiment by default
+ 2025-12-08 b5f6816cea cmd/link: generate DWARF for moduledata
+ 2025-12-08 44a39c9dac runtime: only run TestNotInGoMetricCallback when building with cgo
+ 2025-12-08 3a6a034cd6 runtime: disable TestNotInGoMetricCallback on FreeBSD + race
+ 2025-12-08 4122d3e9ea runtime: use atomic C types with atomic C functions
+ 2025-12-08 34397865b1 runtime: deflake TestProfBufWakeup
+ 2025-12-08 3417b48b17 [dev.simd] simd: add carryless multiply
+ 2025-12-08 d4972f6295 runtime: mark getfp as nosplit
+ 2025-12-05 0d0d5c9a82 test/codegen: test negation with add/sub on riscv64
+ 2025-12-05 2e509e61ef cmd/go: convert some more tests to script tests
+ 2025-12-05 c270e71835 cmd/go/internal/vet: skip -fix on pkgs from vendor or non-main mod
+ 2025-12-05 f51ee08905 [dev.simd] simd: replace checking loops with call to slice-checker
+ 2025-12-03 2b91d96941 [dev.simd] internal/buildcfg: turn GOEXPERIMENT=simd back on

Change-Id: Iaf3a44bb5ada83b0f056032839f5dd0fcdb2294f

4 weeks agocmd/link: set canUsePlugins only on platforms that support plugin
Cherry Mui [Mon, 15 Dec 2025 20:36:23 +0000 (15:36 -0500)]
cmd/link: set canUsePlugins only on platforms that support plugin

If a program imports the plugin package, but the plugin build mode
is not supported on the platform, it still cannot use plugin. Don't
treat it like so.

Updates #76815.

Change-Id: I0fd719427d7c3cc96a94ce1f92d6e4457da92a90
Reviewed-on: https://go-review.googlesource.com/c/go/+/730164
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

4 weeks agocmd/link: don't create __x86.get_pc_thunk symbol if it already exists
Cherry Mui [Mon, 15 Dec 2025 18:45:28 +0000 (13:45 -0500)]
cmd/link: don't create __x86.get_pc_thunk symbol if it already exists

On 386, in some build modes we need to create the __x86.get_pc_thunk
symbols, to support PC-relative addressing. In some situation
the thunk symbols may already exist, e.g. loaded from a C object
in internal linking mode. In this case, we should use the exiting
symbol instead of making a new one. The current code updates the
symbol content in place but also adds a duplicated entry to Textp,
which breaks the address sorting order.

Fixes #76815.

Change-Id: Iab11106ce592dc5219b7a0e07cfafcd270661a2f
Reviewed-on: https://go-review.googlesource.com/c/go/+/730161
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

4 weeks agotext/template: fix slice builtin for pointers to arrays
Nathan Nguyen [Fri, 5 Dec 2025 20:50:24 +0000 (15:50 -0500)]
text/template: fix slice builtin for pointers to arrays

The slice function now properly handles pointers to arrays by calling
indirect() to dereference pointers, matching the behavior of the index
function.

Fixes #39596

Change-Id: Id4920edbfd8fd3df3a181b59a61733f88b0f104d
Reviewed-on: https://go-review.googlesource.com/c/go/+/727400
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
4 weeks agoarchive/tar, compress/bzip2: base64 some troublesome testdata files
Ian Lance Taylor [Fri, 12 Dec 2025 22:18:13 +0000 (14:18 -0800)]
archive/tar, compress/bzip2: base64 some troublesome testdata files

This avoids complaints from scanners that look for and open
tar and bz2 files, and complain if they look weird.
In this case, they do look weird, because they are intentionally strange.
This kind of thing shouldn't be necessary, but we already have the machinery
to do it so it's easy enough.

Fixes #76799

Change-Id: Ib302b3aef30108a1325f91fcb2d166f8e1863792
Reviewed-on: https://go-review.googlesource.com/c/go/+/729780
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
4 weeks agocmd/go: show comparable in go doc interface output
Nathan Nguyen [Fri, 5 Dec 2025 08:25:33 +0000 (03:25 -0500)]
cmd/go: show comparable in go doc interface output

The go doc command now displays the comparable constraint when embedded
in an interface, matching the existing behavior for the error type.

Previously, when an interface embedded comparable, it was not shown in
the documentation and incorrectly triggered the "Has unexported methods"
message even when no unexported methods existed.

Fixes #76125

Change-Id: Idaae07fcb1dfc79b1fae374f9fc68df0052ff38e
Reviewed-on: https://go-review.googlesource.com/c/go/+/727100
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

4 weeks agosimd/archsimd: skip tests if AVX is not available
Cherry Mui [Sat, 13 Dec 2025 03:33:57 +0000 (22:33 -0500)]
simd/archsimd: skip tests if AVX is not available

The simd operations require AVX. If AVX is not available, skip the
tests.

Change-Id: I3c384ba07e1e6c2c198dfb27bc84a2e27f825680
Reviewed-on: https://go-review.googlesource.com/c/go/+/729820
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
4 weeks agocmd/dist: test GOEXPERIMENT=simd on AMD64
Cherry Mui [Fri, 12 Dec 2025 18:31:45 +0000 (13:31 -0500)]
cmd/dist: test GOEXPERIMENT=simd on AMD64

Change-Id: Iaf8bb811cd8c674c801d8e068fcc753e889ac672
Reviewed-on: https://go-review.googlesource.com/c/go/+/729721
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
4 weeks agoruntime, cmd/link: tighten search for stackObjectRecord
Ian Lance Taylor [Wed, 10 Dec 2025 02:56:45 +0000 (18:56 -0800)]
runtime, cmd/link: tighten search for stackObjectRecord

A stackObjectRecord should always be in funcdata, between gofunc
and the end of pclntab, except for the special case of
methodValueCallFrameObjs, which should always be in noptrbss.
Adjust the two loops that look for the moduledata corresponding
to a stackObjectRecord to search more precisely, rather than
relying on datap.end.

Closely based on a patch by Michael Stapelberg.

For #76038

Change-Id: I751801d8fd030af751825a67905b2a343280e7d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/728840
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
4 weeks agoruntime/secret: restore goroutine behavior to proposal
Daniel Morsing [Wed, 10 Dec 2025 10:07:56 +0000 (10:07 +0000)]
runtime/secret: restore goroutine behavior to proposal

During review of CL 704615, a suggestion was made that spawning a
goroutine inside a call to secret.Do result in a panic. I agreed with
this at the time, but had missed that this had been extensively
discussed on the proposal. Revert the behavior back to what was agreed
upon.

Change-Id: Ifaa9e24bd03ecbd870ae2217137d1a9527c96842
Reviewed-on: https://go-review.googlesource.com/c/go/+/728920
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
4 weeks agoruntime: dropg after emitting trace event in preemptPark
Michael Anthony Knyszek [Thu, 11 Dec 2025 19:23:19 +0000 (19:23 +0000)]
runtime: dropg after emitting trace event in preemptPark

Because we dropg before emitting a trace event in preemptPark, we end up
failing to emit a status for the goroutine if this happens to be the
first event for it in the generation. We only really see this with
multiple subscribers in TestSubscribers.

This is for two reasons:
1. If we are missing a status event for a non-initial generation then
   the trace parser won't validate that (an oversight, but we can only
   enforce that for new traces because of this bug), and
2. If we're starting the tracer fresh, then we have a STW which
   effectively guarantees that the first event for a goroutine cannot
   come from preemptPark.

Therefore, we cannot observe this situation unless the first generation
manifests the bug, but prior to having flight recording and/or multiple
subscribers being able to "cut" the trace data at any point, this was
impossible.

The fix is simple: dropg only after emitting the trace event. This is
also safe, because the tracer doesn't care. The tracer will also start
taking a stack trace of the goroutine in this circumstance, but that is
also safe, since we are able to generally unwind the stack of
asynchronously preempted goroutines, and here we're at the very, very
end of asynchronous preemption where all the state to do so is already
set up.

Fixes #75665.

Change-Id: I7ee1142697d0a53b62d4c5647aa53775d2f6976a
Reviewed-on: https://go-review.googlesource.com/c/go/+/729400
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
4 weeks agoruntime/pprof: deflake TestGoroutineLeakProfileConcurrency
Michael Anthony Knyszek [Thu, 11 Dec 2025 17:19:19 +0000 (17:19 +0000)]
runtime/pprof: deflake TestGoroutineLeakProfileConcurrency

Issue #76540 reports failures in this test from the leaked goroutine
count being too small. The test makes an effort to wait for the
goroutines to leak, but there's no guarantee.

This change instead changes TestGoroutineLeakProfileConcurrency to wait
for the number of leaked goroutines to reach at least the minimum
expected before proceeding. This deflakes this particular issue.

The downside of this change is that a failure to detect leaked
goroutines due to a bug will lead to a timeout instead of an instant
failure, but this change makes an effort to log and report that it was
waiting for the goroutines to leak and timed out for that reason, so at
least the failure is more obvious.

Overall, this is still better than random flakes.

While we're here, I also make some minor stylistic changes and document
the helper functions a little more. I also noticed that checkFrames was
using the wrong *testing.T, so this change fixes that too.

Fixes #76540.

Change-Id: I0508855dc39b91f8c6b72d059ce88dbfc68fe748
Reviewed-on: https://go-review.googlesource.com/c/go/+/729280
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

4 weeks agocmd/link: add new linknames to blocked linkname list
Cherry Mui [Fri, 12 Dec 2025 18:00:54 +0000 (13:00 -0500)]
cmd/link: add new linknames to blocked linkname list

Update the blocklist with new linknames added in Go 1.26.

Some goroutine leak profile symbols were manually added but they
did not match the actual symbol names. Corrected.

runtime.freegc is not itself push-linknamed, so there is no need
to explicitly add it to blocklist. Keep the test, to ensure one
cannot linkname-pull freegc.

Change-Id: Ie5fd6bc191e9afa164fa79055cc39e6fa9ed4c7f
Reviewed-on: https://go-review.googlesource.com/c/go/+/729720
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
4 weeks agoruntime/secret: guard files with goexperiment
Cherry Mui [Thu, 11 Dec 2025 19:15:08 +0000 (14:15 -0500)]
runtime/secret: guard files with goexperiment

So if the goexperiment is not enabled, we don't expose an empty
package.

Change-Id: I57c1edac92f51b307d789d8d9bb3b505769af589
Reviewed-on: https://go-review.googlesource.com/c/go/+/729361
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
5 weeks agogo/doc: reuse import name logic for examples
Sean Liao [Mon, 8 Dec 2025 20:48:09 +0000 (20:48 +0000)]
go/doc: reuse import name logic for examples

Examples resolved imports based on just the path name,
but this doesn't work for go-name or modules on v2+.

Updates #12794
Fixes #45110
Fixes #56740
Fixes #62059

Change-Id: I8c71b1e5311df04bccbdf319d759d3176a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/728280
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>