67046 Commits

Author SHA1 Message Date
Cuong Manh Le
dc72b71db0 cmd/compile: speedup large synthetic init function compile time
This CL redo the work in CL 737880 to split large synthetic init
function into smaller ones, allow faster compile time for package with
many global initialization statements.

Updates #80141
Fixes #77153

Change-Id: I8475b6c7ca8bcf997baf043986ba639d897c2510
Reviewed-on: https://go-review.googlesource.com/c/go/+/795261
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2026-07-15 11:04:15 -07:00
Nick Ripley
c1657c45eb cmd/distpack: exclude the .jj directory
The .jj directory is created by the JJ version control system, which
works on top of Git and is used by several Go contributors. Exclude this
directory from binary and source distributions.

Fixes #80408

Change-Id: I559d7bfa7991d52a059cb9aae279cd1d6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/799983
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
2026-07-15 10:49:07 -07:00
qmuntal
6561d9e488 cmd/go: avoid build actions for pure-Go go list -compiled
For go list -compiled, cmd/go currently constructs build actions for
every listed package in order to populate CompiledGoFiles. For pure-Go
packages, that information is already available after package loading:
the compiler inputs are just GoFiles. The builder is only needed for
packages that generate additional Go sources, such as cgo or SWIG
packages, or when list also needs stale, export, or coverage
information.

Avoid constructing build actions for pure-Go packages in the common
-compiled case, and fill CompiledGoFiles directly from GoFiles instead.

On a small repro using:

    go list -e -compiled=true -test=true -export=false -deps=true -find=false -pgo=off ./...

the elapsed time dropped from about 630-690 ms to about 440-490 ms.

Add a GOTMPDIR regression test showing that pure-Go go list -compiled
does not require creating a build work directory.

For #75238.

Change-Id: I5f06536a2047f54f9df530ebbc39db9257f2a49f
Reviewed-on: https://go-review.googlesource.com/c/go/+/787320
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Ian Alexander <jitsu@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
2026-07-15 10:23:15 -07:00
Michael Matloob
b3cbe6a122 cmd/go/internal/work: cache coverage output
We'll now cache the outputs of the coverage action separately from the
rest of the build action. The goal of this change is to enable a future
change that will remove the dependency of generating the dynimport file
provided to the linker on the build action so that it can run in
parallel. But that depends on the contents of the files passed to cgo
which in turn depends on the coverage outputs, if coverage is enabled.

We'll cache the cover output files similarly to how how we cache vet
files by using cacheSrcFiles to cache each of the files and also a
"directory" file containing a list of the cached files.

For #15681

Change-Id: I39808c3a1a65a0c2c22e38a4e661f5736a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/764761
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Hongxiang Jiang <hxjiang@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-07-15 10:04:22 -07:00
Cherry Mui
060245832f all: REVERSE MERGE dev.simd (c29765a) into master
This commit is a REVERSE MERGE.
It merges dev.simd back into its parent branch, master.

Merge List:

+ 2026-07-15 c29765a803 [dev.simd] all: merge master (8871cdc) into dev.simd
+ 2026-07-10 cbb6afc18a [dev.simd] simd/archsimd/_gen: update to Go 1.26
+ 2026-07-09 9f177c644e [dev.simd] simd/archsimd/_gen: run go fix
+ 2026-07-09 57ae1c26af [dev.simd] simd/archsimd/_gen/midway: fix vet errors
+ 2026-07-01 b996c7a19a [dev.simd] all: merge master (9e5cf80) into dev.simd
+ 2026-06-18 0061fdb4b9 [dev.simd] all: merge master (cabdf7f) into dev.simd
+ 2026-06-08 74b92327ab [dev.simd] cmd/go: include simd bridge package in compiled test imports
+ 2026-06-08 a4731efb4f [dev.simd] simd: route HiToLo through Float64x2 and fix codegen tests
+ 2026-06-05 fbe166e065 [dev.simd] all: merge master (d2b991c) into dev.simd

Change-Id: I646b1adece655105d01f41a8eafce9e380a8d43d
2026-07-15 12:13:54 -04:00
Cherry Mui
c29765a803 [dev.simd] all: merge master (8871cdc) into dev.simd
Merge List:

+ 2026-07-15 8871cdca9e cmd/dist: drop all but one custom timeout
+ 2026-07-15 9af3834f31 cmd/dist: drop 3 minute (or 9 for cmd/go) custom timeout for std cmd
+ 2026-07-15 94e11b4d4d cmd/dist: redefine goTest.timeout to raise timeout only, not lower it
+ 2026-07-15 61d964eff9 cmd/compile: fold constant bits reverse operations
+ 2026-07-15 2482f9c242 runtime/pprof: stop logging an error if CPU sampling rate is already configured
+ 2026-07-15 e68a67f6de runtime: implement stackcheck for riscv64
+ 2026-07-15 6e02631cf5 net/netip: don't overallocate in AddrPort.MarshalText
+ 2026-07-14 74499361ee doc: initialize next directory for Go 1.28
+ 2026-07-14 6c87434d24 internal/goversion: update Version to 1.28
+ 2026-07-14 a5f29a67d7 encoding/json/v2: add UnmarshalDecode example
+ 2026-07-14 f5c3217500 net/http: don't rely on server request body not changing
+ 2026-07-14 e824a5b76c encoding/pem: handle error from Close
+ 2026-07-14 e41453845b cmd/vet: improve how stdversion analyzer refers to methods
+ 2026-07-14 e09c10f5bd net/http: return 404 when redirecting paths with escaped slashes
+ 2026-07-14 a4d587ad78 std: address ptrtoerror analyzer diagnostics
+ 2026-07-14 fcf8878823 log/slog: test marshaler output escaping
+ 2026-07-13 a129840779 runtime: be sure to scan small frame introduced by (*sigctxt).pushCall
+ 2026-07-13 eb18b3bb9e html/template: document that Tree is updated after the first execution
+ 2026-07-13 92efe23bc0 text/template, html/template: document calling Funcs after parsing
+ 2026-07-13 ba26848a8e os: document that ReadFile returns *PathError errors
+ 2026-07-13 0b9d31758b os: document Process.Pid
+ 2026-07-13 25de5ebdcd internal/poll: document why zero-byte reads do not wait for readability
+ 2026-07-13 9463584647 cmd/compile: remove no-op ABIConfig.Copy
+ 2026-07-13 96307fb52f math: document Nextafter and Nextafter32 special cases for signed zero
+ 2026-07-13 31525e9db0 cmd/compile: disable merge conditional branches pass
+ 2026-07-13 0969751733 reflect: emphasize issue of function pointer comparison
+ 2026-07-13 1e282a3098 cmd/vet: pull in CL 799441
+ 2026-07-10 03845e30f7 os: don't expect an error from Root.ReadFile from a directory on NetBSD
+ 2026-07-10 668ec589ce os: properly handle trailing / in Root.MkdirAll
+ 2026-07-10 30719fe26f testing: record a test's failure for -failfast after cleanup runs
+ 2026-07-09 63d836396a os: strip trailing slashes in RemoveAll on Plan 9
+ 2026-07-09 ee05e88ea6 simd: remove simd/testdata/ip
+ 2026-07-09 db97d07dbb all: use path for go.mod module path
+ 2026-07-09 f20c97b756 lib/time: update to 2026c/2026c
+ 2026-07-09 0a9b01c5e1 crypto/mlkem: improved semi-expanded wycheproof tests
+ 2026-07-09 4d1000c44e cmd/go: split test_vet script test for improved parallelism
+ 2026-07-09 10f7480a0e cmd/go: split build_overlay script test to improve parallelism
+ 2026-07-08 c1e0cd1296 cmd/fix: pull in CL 791660
+ 2026-07-08 999c71883b go/types, types2: copy test from issue48703 into its own file
+ 2026-07-08 0af88e584c cmd/gofmt: correctly truncate symlinks instead of buggy mangling
+ 2026-07-08 1cee9dbe3f os: rewrite PathError.Path in dirFS.ReadLink to relative name
+ 2026-07-07 82215dc6c0 os: properly handle trailing slashes in paths in Root
+ 2026-07-07 183e201251 go/types, types2: set underlying for imported types
+ 2026-07-07 95a31dacc4 cmd/go: remove net script test condition from main go command suite
+ 2026-07-07 cc0242c5d1 cmd/go: move mod_sumdb_golang network tests to verylongtest
+ 2026-07-07 d426cba592 cmd/go: move part of gotoolchain_net to verylongtest
+ 2026-07-07 9cb0e9cf04 cmd/go: move mod_insecure_issue63845 and mod_proxy_https to verylongtest
+ 2026-07-07 342285ee87 cmd/go/testdata/script: remove net condition from always skipped tests
+ 2026-07-07 a89bf59d33 cmd/go/testdata/script: update mod_prefer_compatible to not use net
+ 2026-07-07 44db00e9c1 cmd/go/testdata/script: don't use network in mod_gonoproxy test
+ 2026-07-07 0f091acc1a cmd/go/testdata/script: remove net from mod_download_private_vcs
+ 2026-07-07 773dae7353 cmd/go/testdata/script: don't use net in mod_pseudo_cache
+ 2026-07-07 2772c8e119 cmd/go/testdata/script: don't use net in mod_sumdb_file_path test
+ 2026-07-07 4a5010f11e cmd/go/testdata/script: stop using network from mod_git_export_subst
+ 2026-07-07 5a4aecaaa4 cmd/go/testdata/script: remove net from gotoolchain_version test
+ 2026-07-07 f14d0eb83a cmd/go/testdata/script: remove net check in get_issue53955 test
+ 2026-07-07 f38d2ed115 cmd/go/testdata/script: don't use network in govcs script test
+ 2026-07-07 0858430834 test: add write barrier test
+ 2026-07-07 cb4d292bb6 net/http: apply header timeout to server's unencrypted HTTP/2 check
+ 2026-07-07 d468ad3648 cmd/go: switch toolchain if necessary in applyUpgrades
+ 2026-07-06 e37f65a2e6 cmd/doc: prefer non-internal packages in shorthand lookup
+ 2026-07-06 8184635a8e net/http: apply Server.MaxHeaderValueCount towards HTTP/1 trailer headers
+ 2026-07-06 976f0044da test : repair codegen/simd mask instructions test
+ 2026-07-02 65504872cb crypto/mldsa: remove hand-defined wycheproof structs
+ 2026-07-02 aa44f96d9f net/http: fix BenchmarkClientRequestHeaders header count failure
+ 2026-07-01 3d3798e7fb net/http/internal/http2: do not silently truncate large trailers
+ 2026-07-01 821f3ff7c8 Revert "net/http: apply header timeout to server's unencrypted HTTP/2 check"
+ 2026-07-01 375872b485 math/big: fix edge case float formatting
+ 2026-07-01 d90bf6d722 net/http: add Server.MaxHeaderValueCount setting

Change-Id: I268aaa4230c359f9fc466dbb1e08bc9b678ea9a0
2026-07-15 11:30:18 -04:00
Dmitri Shuralyov
8871cdca9e cmd/dist: drop all but one custom timeout
Keep only the timeout that goes beyond the default of 10 minutes.
The rest are no-ops as of CL 789886.

Fixes #79970.

Change-Id: Ibd3b6d2c8251e6ad995354cac3bf96bd9ccd9639
Reviewed-on: https://go-review.googlesource.com/c/go/+/790001
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
2026-07-15 08:12:38 -07:00
Dmitri Shuralyov
9af3834f31 cmd/dist: drop 3 minute (or 9 for cmd/go) custom timeout for std cmd
The reason we have these particular custom timeouts in cmd/dist today
is because CL 120762 increased cmd/go timeout from 6 minutes to 9,
and before that CL 84235 increased cmd/go timeout from 3 minutes to 6,
and before that CL 12368 increased std cmd timeout from 2 minutes to 3.
The original 2 minute per-package timeout was added in 14 years ago in
CL 5604051, where the motivation was to have _some_ hard limit.

Today we have a hard limit via the go command (as well as via LUCI), so
it's safe to drop the custom timeout given it has become a no-op as of
CL 789886, and because the original reason it was added continues to be
in place via other means.

For #79970.

Change-Id: I32d3d34cd6d380453d65d43b6ddf90e4b90dec61
Reviewed-on: https://go-review.googlesource.com/c/go/+/790000
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-07-15 08:12:34 -07:00
Dmitri Shuralyov
94e11b4d4d cmd/dist: redefine goTest.timeout to raise timeout only, not lower it
As a gradual step, make it so that setting a custom timeout in goTest
only has effect if it raises the timeout beyond what the go command's
default is (10 minutes at this time).

For #79970.

Change-Id: Iefd397aaafe367e5883d3582aa7dfb6b1ce00f91
Reviewed-on: https://go-review.googlesource.com/c/go/+/789886
Reviewed-by: Michael Matloob <matloob@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-07-15 08:12:31 -07:00
Bob Put
61d964eff9 cmd/compile: fold constant bits reverse operations
The compiler already folds several math/bits intrinsics with constant inputs. Add generic SSA folds for constant Reverse, ReverseBytes, and their narrower forms after they lower to BitRev and Bswap ops.

This removes residual reverse instructions for constant arguments while leaving target-specific lowering unchanged for variable arguments.

For #21872.

Change-Id: I16d8192e9b900a8ded75cb51f411382e9c987880
Reviewed-on: https://go-review.googlesource.com/c/go/+/782462
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-15 08:12:16 -07:00
Nick Ripley
2482f9c242 runtime/pprof: stop logging an error if CPU sampling rate is already configured
The runtime.SetCPUProfileRate function configures the CPU profiling
sampling rate and starts profiling if the rate is non-zero. If the
function is called with a non-zero rate and profiling is already
enabled, the function logs a warning to standard error. This is a
hard-coded print and can't be turned off. However,
runtime.SetCPUProfileRate is the only way to configure the profiling
frequency, since pprof.StartCPUProfile doesn't provide an option to
change the rate. That function calls runtime.SetCPUProfileRate with a
hard-coded default of 100. This means that the following code logs an
error:

	runtime.SetCPUProfileRate(200)
	pprof.StartCPUProfile(w)

The error is misleading. CPU profiling is working after the second call,
sampling at 200 Hz as intended. The error is also annoying for something
like a continuous profiling library, which stops and starts CPU
profiling regularly and thus prints a useless log repeatedly.

This CL gives pprof.StartCPUProfile a way to set the sampling rate and
start profiling without logging the error if the user already set the
sampling rate. Calling runtime.SetCPUProfileRate twice with a non-zero
rate will still log an error.

Fixes #79900

Change-Id: Icb89bb4ed66689c5a91ce5a677edff126a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/787580
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Florian Lehner <lhnr.flrn@gmail.com>
Auto-Submit: Nick Ripley <nick.ripley@datadoghq.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-15 08:09:57 -07:00
Mauri de Souza Meneguzzo
e68a67f6de runtime: implement stackcheck for riscv64
Change-Id: I5bf1c23e115ebac06eec9fb301777b58407327ef
GitHub-Last-Rev: 42ea3c2f588b8fb52d98390faebd8d89c8ba0e1a
GitHub-Pull-Request: golang/go#64074
Reviewed-on: https://go-review.googlesource.com/c/go/+/541735
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2026-07-15 08:08:55 -07:00
Tobias Klauser
6e02631cf5 net/netip: don't overallocate in AddrPort.MarshalText
In case of an IPv4-in-IPv6 address, the buffer would be too large.
Follow the implementation in Addr.MarshalText and only allocate a
buffer large enough for the largest possible IPv4-in-IPv6 with port.
While at it, also streamline the MarshalText implementations to be as
similar as possible to Addr.MarshalText.

Change-Id: I884a275089385571a7019545e8a01b45b7325461
Reviewed-on: https://go-review.googlesource.com/c/go/+/779700
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Florian Lehner <lhnr.flrn@gmail.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
2026-07-15 08:07:29 -07:00
Michael Matloob
74499361ee doc: initialize next directory for Go 1.28
Following the "For the release team" steps in README:

	cd doc
	cp -R initial/ next
	$EDITOR next/1-intro.md

For #79581

Change-Id: I0e56193e2020d0d3804fde9ec6114bef6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/800722
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-14 15:21:20 -07:00
Michael Matloob
6c87434d24 internal/goversion: update Version to 1.28
Go 1.28 is in the process of being opened for development (to be
eventually released). This change marks the very beginning of its
development cycle, updating the Version value accordingly.

For #40705
For #79581

Change-Id: I5612e7ed16f64ef94fdfb53f0f6481e16a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/800721
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2026-07-14 15:10:00 -07:00
Michael Pratt
a5f29a67d7 encoding/json/v2: add UnmarshalDecode example
Add an example of using UnmmarshalDecode to unmarshal a stream of JSON
values.

This example is pretty much a straight port of
encoding/json.ExampleDecode.

Change-Id: I9625db144dcad658ac762646ffcc4f016a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/800640
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
2026-07-14 15:07:43 -07:00
Damien Neil
f5c3217500 net/http: don't rely on server request body not changing
Middleware layers might change a server Request's body,
wrapping it in some other type or replacing it entirely.

Remove various type assertions of a response.req.Body
to *body or *expectContinueReader. Instead, add fields
on the response that track the original body.

Add a test demonstrating one bug which this fixes:
TestServerConnectionReuse/large_wrapped_body
previously failed because response.closedRequestBodyEarly
failed to recognize an early-closed request body when
the body of the Request provided to the handler was
modified.

This CL introduces a small behavioral change: When sending
a response to an HTTP/1 request, we attempt to consume
the request body before sending the response (except
when full duplex responses are enabled). When the request
body is larger than maxPostHandlerReadBytes,
we now make one attempt to drain it. Previously, we would
make one direct read from the Request.Body (possibly
replaced by milddleware), followed by a second read in
(*body).Close when cleaning up the request if the first
read failed to drain the body. We now call (*body).Close
in both places, which will perform the drain exactly once.

Change-Id: I0f9507c1bd4d24bfc80daf82c5fdb0746a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/794640
Reviewed-by: Nicholas Husin <nsh@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Nicholas Husin <husin@google.com>
2026-07-14 14:28:35 -07:00
Weixie Cui
e824a5b76c encoding/pem: handle error from Close
Change-Id: I80de837203b6d35b303bf8127447d78f09f82c31
GitHub-Last-Rev: d6f1671f9f9a87026a10864197c4a924f5b7e654
GitHub-Pull-Request: golang/go#79641
Reviewed-on: https://go-review.googlesource.com/c/go/+/782400
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Mateusz Poliwczak <mpoliwczak34@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2026-07-14 14:08:59 -07:00
Dmitri Shuralyov
e41453845b cmd/vet: improve how stdversion analyzer refers to methods
Pull in the fix implemented in CL 800620.

Fixes #80363.

[git-generate]
updatestd -goroot=$(pwd) -branch=internal-branch.go1.27-vendor

Change-Id: I1b4dcbccdaa22f0949edd9add26fae0a3ff5409a
Reviewed-on: https://go-review.googlesource.com/c/go/+/798502
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Commit-Queue: Alan Donovan <adonovan@google.com>
2026-07-14 13:21:45 -07:00
Nicholas S. Husin
e09c10f5bd net/http: return 404 when redirecting paths with escaped slashes
When a FileServer redirects to a canonical path, it uses relative
redirects, to ensure compatibility with StripPrefix. If the request path
contained escaped slashes (%2f), the relative redirect can be
misresolved because the client and server disagree on the path segments.

Since there is no generalized fix that works in all cases, return a 404
instead of redirecting when the request path contains escaped slashes.

For #80289

Change-Id: Ice139c4ed2ece221eb36225c7ddcd2fb6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/799982
Commit-Queue: Nicholas Husin <nsh@golang.org>
Auto-Submit: Nicholas Husin <nsh@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
2026-07-14 13:19:51 -07:00
Alan Donovan
a4d587ad78 std: address ptrtoerror analyzer diagnostics
Gopls' new ptrtoerror analyzer (CL 798580) reports types E such that
both E and *E implement error and there is no clear intent as to
which one is preferred.

This CL cleans up nearly all such diagnostics in std by adding
explicit assertions such as 'var _ error = E{}'.

Two mistaken uses of scanner.Error (sans &) were fixed,
and several unnecessary embeddings of error in tests were
change to use a plain named field.

Change-Id: I1dbf4abd5750e69c34653a1cdd17fa04edfbc6e4
Reviewed-on: https://go-review.googlesource.com/c/go/+/800560
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Commit-Queue: Alan Donovan <adonovan@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
2026-07-14 09:39:56 -07:00
Ilya Torbin
fcf8878823 log/slog: test marshaler output escaping
Check that MarshalText and MarshalJSON output is escaped when writing JSON log records.

Change-Id: Iacda60699c4167246d8b78ebed6a9fb5e33c1840
Reviewed-on: https://go-review.googlesource.com/c/go/+/799420
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Sean Liao <sean@liao.dev>
2026-07-14 09:32:54 -07:00
khr@golang.org
a129840779 runtime: be sure to scan small frame introduced by (*sigctxt).pushCall
On arm64, the contents of R30 are saved in this 16-byte frame (when
doing async preemption). But we don't scan that little frame. So any
pointer that was in R30 will not get scanned. So the object it points
to may get collected prematurely.

Fixes #80188

The test here is pretty quick (~1/3 sec) and fails ~50% of the time.

Change-Id: I46a7a6a25fabeb4f15dca96ee6fdd5e99d4c6323
Reviewed-on: https://go-review.googlesource.com/c/go/+/797521
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
2026-07-13 14:06:37 -07:00
Julian Soreavis
eb18b3bb9e html/template: document that Tree is updated after the first execution
Fixes #43064

Change-Id: Ie693c05563e5694b8ba57eebd459d3c0a2d2a4d6
GitHub-Last-Rev: 91709d7908533ee5441565b3f0c19a3d14087b1b
GitHub-Pull-Request: golang/go#80336
Reviewed-on: https://go-review.googlesource.com/c/go/+/799061
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-13 13:13:23 -07:00
Julian Soreavis
92efe23bc0 text/template, html/template: document calling Funcs after parsing
Funcs was documented only as "It must be called before the template is
parsed", which suggests it cannot be called afterward. In fact a
function used in the template must be registered before parsing, but
Funcs may be called again later (including after Clone) to replace a
function of the same name, and the replacement takes effect when the
template is executed.

Fixes #34680

Change-Id: I819bc3bcb7452b2fd0bd08d2e97e737493944029
GitHub-Last-Rev: a521e2c82a9e8f3ed09c3ec5bcbf98f33b0d1933
GitHub-Pull-Request: golang/go#80356
Reviewed-on: https://go-review.googlesource.com/c/go/+/799340
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Rob Pike <r@golang.org>
2026-07-13 12:41:46 -07:00
Sean Rogers
ba26848a8e os: document that ReadFile returns *PathError errors
ReadFile opens the file with Open and reads it with File.Read, both of
which return errors of type *PathError. Document this on ReadFile, as is
already done for Open and other functions in the package, so callers know
they can inspect the error (for example with errors.As) without reading
the source.

Fixes #80111

Change-Id: Ifb4b10127c2cf8daae661d136d5d9edbc4613e8a
Reviewed-on: https://go-review.googlesource.com/c/go/+/795160
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Maciej Szeptuch <mszeptuch@gmail.com>
Reviewed-by: Sean Liao <sean@liao.dev>
2026-07-13 12:41:37 -07:00
Julian Soreavis
0b9d31758b os: document Process.Pid
Pid is an exported field but had no doc comment.

Fixes #36726

Change-Id: I4eb213c004f7bcfcab758a56554b489ce6eb7305
GitHub-Last-Rev: d00a4922260efce244b8d402b09e136833d19532
GitHub-Pull-Request: golang/go#80337
Reviewed-on: https://go-review.googlesource.com/c/go/+/799062
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-13 12:39:37 -07:00
Faizan Shaik
25de5ebdcd internal/poll: document why zero-byte reads do not wait for readability
The TODO asked whether a zero-byte Read should wait for readability.
CL 22031 proposed that behavior and was abandoned. Blocking would
change the behavior of existing callers, and the netpoller's
edge-triggered notifications alone cannot detect data that is
already buffered. Replace the stale TODO with the outcome.

Updates #15735

Change-Id: Iad2087b123db58e6bf531f81f8411f363a5b2a1a
GitHub-Last-Rev: 0c3e22b1d972dbd31a6a9155c6483a8fdbb25b88
GitHub-Pull-Request: golang/go#80244
Reviewed-on: https://go-review.googlesource.com/c/go/+/796620
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2026-07-13 12:37:16 -07:00
cuishuang
9463584647 cmd/compile: remove no-op ABIConfig.Copy
ABIConfig.Copy became a no-op after the register cache was removed.
Its only caller still treated the returned configuration as a fresh
copy, even though Copy simply returned its receiver.

Remove Copy, use the shared ABI0 configuration directly, and update
the stale comments describing copied ABI configurations.

Change-Id: I23e51c197811ec409473737b570232e459ec79b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/796120
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-13 12:22:00 -07:00
Julian Soreavis
96307fb52f math: document Nextafter and Nextafter32 special cases for signed zero
Nextafter and Nextafter32 have distinct behavior when the starting
value is a signed zero, which the special-case lists did not mention:
towards the oppositely-signed zero the result keeps the starting sign,
and towards any nonzero y the result is the smallest subnormal with the
sign of y. Document these cases; the behavior is unchanged.

Fixes #42613

Change-Id: I8c6f0f3fc821d285d6870e76edf72391b124d350
GitHub-Last-Rev: 34eb6cc9b47720f3d330b1d385a16fd62adae107
GitHub-Pull-Request: golang/go#80359
Reviewed-on: https://go-review.googlesource.com/c/go/+/799400
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2026-07-13 12:15:22 -07:00
Keith Randall
31525e9db0 cmd/compile: disable merge conditional branches pass
It's late in the cycle, let's just disable this new pass and
try again for 1.28.

Update #80102

Change-Id: Idcda2814e22f017999813a52b06013df3735bf18
Reviewed-on: https://go-review.googlesource.com/c/go/+/799700
Reviewed-by: Chencheng Jiang <dorbmons@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
2026-07-13 10:07:30 -07:00
Cherry Mui
0969751733 reflect: emphasize issue of function pointer comparison
Using reflect.Value.Pointer to compare function values for
equality is problematic. For closures, the same code pointer does
not necessarily mean the functions have the same behavior, as the
captured variables may have different values, which are not
included in the comparison.

Change-Id: Ib95912cce52d3863f8fe77d874ffa2f277dbd0b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/788441
Reviewed-by: Austin Clements <austin@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-13 07:52:17 -07:00
Dmitri Shuralyov
1e282a3098 cmd/vet: pull in CL 799441
Fixes #80360.

[git-generate]
updatestd -goroot=$(pwd) -branch=internal-branch.go1.27-vendor

Change-Id: I0c866cf97f621b8399c8982de4ca568be9043eed
Reviewed-on: https://go-review.googlesource.com/c/go/+/799620
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-13 05:55:04 -07:00
Austin Clements
cbb6afc18a [dev.simd] simd/archsimd/_gen: update to Go 1.26
Surprisingly, nothing to go fix with this update.

Change-Id: I286675ad23372ee42ba03cb1c8701f74db5a24a2
Reviewed-on: https://go-review.googlesource.com/c/go/+/798845
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2026-07-10 13:39:50 -07:00
Damien Neil
03845e30f7 os: don't expect an error from Root.ReadFile from a directory on NetBSD
read() on a directory file seems like it should produce an error,
just like every other Unix, but #80322 indicates that it doesn't seem to.

Just check that we're consistent with the non-Root case.

Fixes #80322

Change-Id: I499f9b0e2bac8e87647c83c5098db9cf6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/799080
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-10 12:31:49 -07:00
Damien Neil
668ec589ce os: properly handle trailing / in Root.MkdirAll
MkdirAll("dir/") should create "dir", not return an error.

Fixes #80308

Change-Id: I75458c30b6cb94be3a3d368f6024caef6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/799064
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
2026-07-10 12:31:37 -07:00
harjoth
30719fe26f testing: record a test's failure for -failfast after cleanup runs
The -failfast flag stops a test binary from starting new tests after
the first failure.

When a test had a parallel subtest, its failure was recorded before
its cleanup functions ran. A failure inside a t.Cleanup was therefore
not counted, and -failfast kept starting new tests. Tests without a
parallel subtest run their cleanup earlier and were unaffected.

Record the failure after cleanup has run, so a cleanup failure counts
for -failfast regardless of whether the test has a parallel subtest.

Fixes #61034

Change-Id: Icea654cbaf3904936200566d7d7d72ca8ccc5958
GitHub-Last-Rev: e46ad5ad314c5cee2a835be3627f4a6455b81c32
GitHub-Pull-Request: golang/go#80165
Reviewed-on: https://go-review.googlesource.com/c/go/+/794541
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-10 09:47:20 -07:00
David du Colombier
63d836396a os: strip trailing slashes in RemoveAll on Plan 9
CL 797880 changed Root to handle trailing slashes in
paths and added TestRootConsistencyRemoveAll.

However, this test is failing on Plan 9 because the "noat"
implementation of RemoveAll disagrees with Root.RemoveAll
when a path ends in a slash and its target is not a
directory. Root.RemoveAll strips the trailing slash and
removes the file, while os.RemoveAll leaves the slash in
place. On Plan 9, Remove and Lstat then fail on the
slash-terminated path, so os.RemoveAll returns an error
instead.

This change strips trailing slashes in the "noat"
implementation of RemoveAll, so RemoveAll("not_a_directory/")
removes the file and returns nil, and remains consistent
with the "at" implementation and Root.RemoveAll.

Fixes #80319.

Change-Id: I5c47ccd239c629da78772f39a831cccf8c9d1500
Reviewed-on: https://go-review.googlesource.com/c/go/+/798721
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Richard Miller <millerresearch@gmail.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-09 17:06:40 -07:00
Michael Pratt
ee05e88ea6 simd: remove simd/testdata/ip
As far as I can tell, this is dead code.

Change-Id: Ibd1c30197a785ade97bb2c98a9cfdd5b6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/799020
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: David Chase <drchase@google.com>
2026-07-09 13:54:34 -07:00
Michael Pratt
db97d07dbb all: use path for go.mod module path
We have various small submodules in the repository, mostly used for code
generation tools with external dependencies.

Currently naming is fairly ad-hoc. Some name the module based on the
path of the directory, while others use a single name like _gen.

If a developer creates a go.work file creating a workspace containing
these submodules (go work use -r .) [1], then all module names must be
unique.

Since CL 772102, we have two modules named _gen, so any operation after
creating go.work immediately fails with a duplicate module error.

Resolve this by using module paths based on the path to the directory.
The load bearing changes here are modifying
cmd/compile/internal/ssa/_gen/go.mod and/or simd/archsimd/_gen/go.mod so
they no longer conflict, but I've changed all module paths to use the
same naming scheme for consistency.

Note that std and cmd get special treatment by cmd/go, so avoid those
prefixes. e.g., the cmd/vet modules seem to ignore the Go language
version when using a cmd/ prefix.

[1] I found this issue because the build process for cross-references on
https://cs.opensource.google/go does this and is currently broken.

Change-Id: I8b3a351c16bd6d52192fb7b45186c38f6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/798560
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2026-07-09 13:36:03 -07:00
Austin Clements
9f177c644e [dev.simd] simd/archsimd/_gen: run go fix
Change-Id: I38bf2c17f031f6d592726ed26ad689bc0c182273
Reviewed-on: https://go-review.googlesource.com/c/go/+/798842
Auto-Submit: Austin Clements <austin@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2026-07-09 12:16:30 -07:00
Austin Clements
57ae1c26af [dev.simd] simd/archsimd/_gen/midway: fix vet errors
Change-Id: I0c4374740c6382bffd066f09a9987120745f3ef2
Reviewed-on: https://go-review.googlesource.com/c/go/+/798841
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Austin Clements <austin@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-09 12:13:02 -07:00
Kyle Shannon
f20c97b756 lib/time: update to 2026c/2026c
Commit generated by update.bash.

For #22487.

Change-Id: If8e3d4a0a2584897926b75bd0aa41756e4457c37
Reviewed-on: https://go-review.googlesource.com/c/go/+/798480
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-09 11:24:04 -07:00
Daniel McCarney
0a9b01c5e1 crypto/mlkem: improved semi-expanded wycheproof tests
Takes an upstream update to the Wycheproof test vectors. This includes
an update to the ML-KEM semi-expanded form decapsulation test schema
that adds the expected K. We use that to tighten up
TestMLKEMSemiExpandedDecapsWycheproof to take advantage.

Change-Id: I67abcc9c1c6728ab154742f9a466e18be22eef89
Reviewed-on: https://go-review.googlesource.com/c/go/+/792940
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-09 10:38:24 -07:00
Michael Matloob
4d1000c44e cmd/go: split test_vet script test for improved parallelism
For #78152

Change-Id: I0e0a0a4bcec2c3785619162bd837fbe76a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/798361
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: David Chase <drchase@google.com>
2026-07-09 10:29:21 -07:00
Michael Matloob
10f7480a0e cmd/go: split build_overlay script test to improve parallelism
For #78152

Change-Id: I910830b8439a63697ccc4f01dc19f2776a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/798320
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-07-09 10:29:16 -07:00
Dmitri Shuralyov
c1e0cd1296 cmd/fix: pull in CL 791660
Generated with updatestd, though it's equivalent to manually running:

cd src/cmd
go get golang.org/x/tools@internal-branch.go1.27-vendor  # v0.45.1-0.20260708165844-7044391f8d9f
go mod tidy
go mod vendor

Fixes #78452.

[git-generate]
updatestd -goroot=$(pwd) -branch=internal-branch.go1.27-vendor

Change-Id: I633f029a6c2201b92c499a8a4e2534c6824946d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/798501
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Madeline Kalil <mkalil@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-08 13:42:28 -07:00
Mark Freeman
999c71883b go/types, types2: copy test from issue48703 into its own file
Monomorphization checks do not run in the presence of errors, which was
suppressing the error from this test and making it appear to pass. This
is a bit misleading.

For #48703
For #80172

Change-Id: I87f672275df189366b88cf3ffac8b3d21b7a1a83
Reviewed-on: https://go-review.googlesource.com/c/go/+/798500
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2026-07-08 13:35:22 -07:00
Artem V. Navrotskiy
0af88e584c cmd/gofmt: correctly truncate symlinks instead of buggy mangling
Currenty `go fmt` does not truncate the symlinked file, as it compares
the size of the recorded data not with the real file size, but with
the symlink reference path length.

Fixes #79735

Change-Id: I0cedccb061aa1a9844bce698c19cb0e96e2e3d14
GitHub-Last-Rev: 6126f26df475ab0fe090299eff88a3429fd804df
GitHub-Pull-Request: golang/go#79774
Reviewed-on: https://go-review.googlesource.com/c/go/+/785800
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-08 11:34:45 -07:00
Tobias Klauser
1cee9dbe3f os: rewrite PathError.Path in dirFS.ReadLink to relative name
All other dirFS methods (Open, ReadFile, ReadDir, Stat, Lstat) rewrite
PathError.Path to the relative name on error. Do the same in
dirFS.ReadLink to be consistent and so callers of
DirFS("/prefix").ReadLink("file") see PathError{Path: "file"} instead of
PathError{Path: "/prefix/file"}.

Change-Id: Id49cb43d79f459c855f94e5544e4c727fe68a7b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/796540
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-08 08:40:38 -07:00