]> Cypherpunks repositories - gostls13.git/log
gostls13.git
8 months ago[release-branch.go1.23] go/types, types2: unalias tilde terms in underIs
Tim King [Thu, 15 Aug 2024 23:48:42 +0000 (16:48 -0700)]
[release-branch.go1.23] go/types, types2: unalias tilde terms in underIs

Unalias the ~T terms during underIs. Before, if T was an alias
of U, it may pass T to the iteration function. The iterator
function expects an underlying type, under(U), to be passed.
This caused several bugs where underIs is used without
eventually taking the underlying type.

Fixes #68905

Change-Id: Ie8691d8dddaea00e1dcba94d17c0f1b021fc49a2
Reviewed-on: https://go-review.googlesource.com/c/go/+/606075
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
(cherry picked from commit 1a90dcdaaf46d9dd0ee61781dcb9b6e05b80d926)
Reviewed-on: https://go-review.googlesource.com/c/go/+/607635

8 months ago[release-branch.go1.23] runtime: store bp on cgocallback as unsafe.Pointer
Michael Anthony Knyszek [Tue, 27 Aug 2024 15:34:10 +0000 (15:34 +0000)]
[release-branch.go1.23] runtime: store bp on cgocallback as unsafe.Pointer

As of CL 580255, the runtime tracks the frame pointer (or base pointer,
bp) when entering syscalls, so that we can use fpTracebackPCs on
goroutines that are sitting in syscalls. That CL mostly got things
right, but missed one very subtle detail.

When calling from Go->C->Go, the goroutine stack performing the calls
when returning to Go is free to move around in memory due to growth,
shrinking, etc. But upon returning back to C, it needs to restore
gp.syscall*, including gp.syscallsp and gp.syscallbp. The way syscallsp
currently gets updated is automagically: it's stored as an
unsafe.Pointer on the stack so that it shows up in a stack map. If the
stack ever moves, it'll get updated correctly. But gp.syscallbp isn't
saved to the stack as an unsafe.Pointer, but rather as a uintptr, so it
never gets updated! As a result, in rare circumstances, fpTracebackPCs
can correctly try to use gp.syscallbp as the starting point for the
traceback, but the value is stale.

This change fixes the problem by just storing gp.syscallbp to the stack
on cgocallback as an unsafe.Pointer, like gp.syscallsp. It also adds a
comment documenting this subtlety; the lack of explanation for the
unsafe.Pointer type on syscallsp meant this detail was missed -- let's
not miss it again in the future.

Now, we have a fix, what about a test? Unfortunately, testing this is
going to be incredibly annoying because the circumstances under which
gp.syscallbp are actually used for traceback are non-deterministic and
hard to arrange, especially from within testprogcgo where we don't have
export_test.go and can't reach into the runtime.

So, instead, add a gp.syscallbp check to reentersyscall and
entersyscallblock that mirrors the gp.syscallbp consistency check. This
probably causes some miniscule slowdown to the syscall path, but it'll
catch the issue without having to actually perform a traceback.

For #69085.
Fixes #69087.

Change-Id: Iaf771758f1666024b854f5fbe2b2c63cbe35b201
Reviewed-on: https://go-review.googlesource.com/c/go/+/608775
Reviewed-by: Nick Ripley <nick.ripley@datadoghq.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
(cherry picked from commit 54fe0fd43fcf8609666c16ae6d15ed92873b1564)
Reviewed-on: https://go-review.googlesource.com/c/go/+/608835

8 months ago[release-branch.go1.23] go/types, types2: use max(fileVersion, go1.21) if fileVersion...
Michael Matloob [Fri, 16 Aug 2024 19:13:39 +0000 (15:13 -0400)]
[release-branch.go1.23] go/types, types2: use max(fileVersion, go1.21) if fileVersion present

Change the rules for how //go:build "file versions" are applied: instead
of considering whether a file version is an upgrade or downgrade from
the -lang version, always use max(fileVersion, go1.21). This prevents
file versions from downgrading the version below go1.21.  Before Go 1.21
the //go:build version did not have the meaning of setting the file's
langage version.

This fixes an issue that was appearing in GOPATH builds: Go 1.23.0
started providing -lang versions to the compiler in GOPATH mode (among
other places) which it wasn't doing before, and it set -lang to the
toolchain version (1.23). Because the -lang version was greater than
go1.21, language version used to compile the file would be set to the
//go:build file version. //go:build file versions below 1.21 could cause
files that could previously build to stop building.

For example, take a Go file with a //go:build line specifying go1.10.
If that file used a 1.18 feature, that use would compile fine with a Go
1.22 toolchain. But it would produce an error when compiling with the
1.23.0 toolchain because it set the language version to 1.10 and
disallowed the 1.18 feature. This breaks backwards compatibility: when
the build tag was added, it did not have the meaning of restricting the
language version.

For #68658
Fixes #69094

Change-Id: I6cedda81a55bcccffaa3501eef9e2be6541b6ece
Reviewed-on: https://go-review.googlesource.com/c/go/+/607955
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
(cherry picked from commit aeac0b6cbfb42bc9c9301913a191bb09454d316a)
Reviewed-on: https://go-review.googlesource.com/c/go/+/608935

8 months ago[release-branch.go1.23] runtime: on AIX, fix call to _cgo_sys_thread_create in _rt0_p...
Paul E. Murphy [Mon, 19 Aug 2024 20:08:14 +0000 (15:08 -0500)]
[release-branch.go1.23] runtime: on AIX, fix call to _cgo_sys_thread_create in _rt0_ppc64_aix_lib

The AIX ABI requires allocating parameter save space when calling
a function, even if the arguments are passed via registers.

gcc sometimes uses this space. In the case of the cgo c-archive
tests, it clobbered the storage space of argc/argv which prevented
the test program from running the expected test.

Fixes #68973

Change-Id: I8a267b463b1abb2b37ac85231f6c328f406b7515
Reviewed-on: https://go-review.googlesource.com/c/go/+/606895
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/go/+/607195
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
8 months ago[release-branch.go1.23] go/types, types2: Named.cleanup must also handle *Alias types
Robert Griesemer [Thu, 15 Aug 2024 23:07:04 +0000 (16:07 -0700)]
[release-branch.go1.23] go/types, types2: Named.cleanup must also handle *Alias types

Named.cleanup is called at the end of type-checking to ensure that
a named type is fully set up; specifically that it's underlying
field is not (still) a Named type. Now it can also be an *Alias
type. Add this case to the respective type switch.

Fixes #68894.

Change-Id: I29bc0024ac9d8b0152a3d97c82dd28d09d5dbd66
Reviewed-on: https://go-review.googlesource.com/c/go/+/605977
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/606656

8 months ago[release-branch.go1.23] unique: use TypeFor instead of TypeOf to get type in Make
Michael Anthony Knyszek [Wed, 21 Aug 2024 14:38:30 +0000 (14:38 +0000)]
[release-branch.go1.23] unique: use TypeFor instead of TypeOf to get type in Make

Currently the first thing Make does it get the abi.Type of its argument,
and uses abi.TypeOf to do it. However, this has a problem for interface
types, since the type of the value stored in the interface value will
bleed through. This is a classic reflection mistake.

Fix this by implementing and using a generic TypeFor which matches
reflect.TypeFor. This gets the type of the type parameter, which is far
less ambiguous and error-prone.

For #68990.
Fixes #68992.

Change-Id: Idd8d9a1095ef017e9cd7c7779314f7d4034f01a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/607355
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit 755c18ecdfe64df060be91fb669ca1a68527830b)
Reviewed-on: https://go-review.googlesource.com/c/go/+/607435
Reviewed-by: Ian Lance Taylor <iant@google.com>
8 months ago[release-branch.go1.23] os: use O_EXCL instead of O_TRUNC in CopyFS to disallow rewri...
Andy Pan [Fri, 16 Aug 2024 00:04:57 +0000 (08:04 +0800)]
[release-branch.go1.23] os: use O_EXCL instead of O_TRUNC in CopyFS to disallow rewriting existing files does not exist

On Linux, a call to creat() is equivalent to calling open() with flags
equal to O_CREAT|O_WRONLY|O_TRUNC, which applies to other platforms
as well in a similar manner. Thus, to force CopyFS's behavior to
comply with the function comment, we need to replace O_TRUNC with O_EXCL.

Fixes #68907

Change-Id: I3e2ab153609d3c8cf20ce5969d6f3ef593833cd1
Reviewed-on: https://go-review.googlesource.com/c/go/+/606095
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
(cherry picked from commit aa5d672a00f5bf64865d0e821623ed29bc416405)
Reviewed-on: https://go-review.googlesource.com/c/go/+/606415

8 months ago[release-branch.go1.23] os: fix Chtimes test flakes
Kir Kolyshkin [Thu, 8 Aug 2024 20:11:14 +0000 (13:11 -0700)]
[release-branch.go1.23] os: fix Chtimes test flakes

It appears that some builders (notably, linux-arm) have some additional
security software installed, which apparently reads the files created by
tests. As a result, test file atime is changed, making the test fail
like these:

=== RUN   TestChtimesOmit
    ...
    os_test.go:1475: atime mismatch, got: "2024-07-30 18:42:03.450932494 +0000 UTC", want: "2024-07-30 18:42:02.450932494 +0000 UTC"

=== RUN   TestChtimes
    ...
    os_test.go:1539: AccessTime didn't go backwards; was=2024-07-31 20:45:53.390326147 +0000 UTC, after=2024-07-31 20:45:53.394326118 +0000 UTC

According to inode(7), atime is changed when more than 0 bytes are read
from the file. So, one possible solution to these flakes is to make the
test files empty, so no one can read more than 0 bytes from them.

For #68687
For #68663
Fixes #68812

Change-Id: Ib9234567883ef7b16ff8811e3360cd26c2d6bdab
Reviewed-on: https://go-review.googlesource.com/c/go/+/604315
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Kirill Kolyshkin <kolyshkin@gmail.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
(cherry picked from commit 84266e1469cfa6fa8e1b41518528a96950db7562)
Reviewed-on: https://go-review.googlesource.com/c/go/+/604196

8 months ago[release-branch.go1.23] go1.23.0 go1.23.0
Gopher Robot [Tue, 13 Aug 2024 15:39:36 +0000 (15:39 +0000)]
[release-branch.go1.23] go1.23.0

Change-Id: I2b0514157b85ca61f9f6b8931df6ac874598a045
Reviewed-on: https://go-review.googlesource.com/c/go/+/605215
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Gopher Robot <gobot@golang.org>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 months ago[release-branch.go1.23] revert "go/types, types2: only use fileVersion if 1.21 or...
Carlos Amedee [Tue, 13 Aug 2024 13:53:09 +0000 (13:53 +0000)]
[release-branch.go1.23] revert "go/types, types2: only use fileVersion if 1.21 or greater"

This reverts commit CL 604935.

Reason for revert: The team has decided that this change will be added to a point release.

Change-Id: I1c1032b881c3a98312a4753b9767cb7c8eed9e09
Reviewed-on: https://go-review.googlesource.com/c/go/+/605096
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
8 months ago[release-branch.go1.23] go/types, types2: only use fileVersion if 1.21 or greater
Michael Matloob [Wed, 7 Aug 2024 17:09:18 +0000 (13:09 -0400)]
[release-branch.go1.23] go/types, types2: only use fileVersion if 1.21 or greater

Only honor //go:build language version downgrades if the version
specified is 1.21 or greater. Before 1.21 the version in //go:build
lines didn't have the meaning of setting the file's language version.

This fixes an issue that was appearing in GOPATH builds: Go 1.23 started
providing -lang versions to the compiler in GOPATH mode (among other
places) which it wasn't doing before.

For example, take a go file with a //go:build line specifying go1.10.
If that file used a 1.18 feature, that use would compile fine with a Go
1.22 toolchain. But, before this change, it would produce an error when
compiling with the 1.23 toolchain because it set the language version to
1.10 and disallowed the 1.18 feature. This breaks backwards
compatibility: when the build tag was added, it did not have the meaning
of restricting the language version.

Fixes #68658

Change-Id: I4ac2b45a981cd019183d52ba324ba8f0fed93a8e
Reviewed-on: https://go-review.googlesource.com/c/go/+/603895
Reviewed-by: Robert Griesemer <gri@google.com>
Commit-Queue: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Matloob <matloob@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/go/+/604935

9 months ago[release-branch.go1.23] crypto/tls: fix testHandshake close flakes
Filippo Valsorda [Thu, 1 Aug 2024 21:41:13 +0000 (23:41 +0200)]
[release-branch.go1.23] crypto/tls: fix testHandshake close flakes

The flakes were introduced by me in CL 586655. It's unclear why only
FreeBSD seems affected, maybe other TCP stacks handle sending on a
half-closed connection differently, or aren't as quick to propagate the
RST over localhost.

Updates #68155

Change-Id: I32a1b474a7d6531dbab93910c23568b867629e8c
Reviewed-on: https://go-review.googlesource.com/c/go/+/602635
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
9 months ago[release-branch.go1.23] types2, go/types: fix instantiation of named type with generi...
Cuong Manh Le [Thu, 25 Jul 2024 10:17:44 +0000 (17:17 +0700)]
[release-branch.go1.23] types2, go/types: fix instantiation of named type with generic alias

The typechecker is assuming that alias instances cannot be reached from
a named type. However, when type parameters on aliases are permited, it
can happen.

This CL changes the typechecker to propagate the correct named instance
is being expanded.

Updates #46477
Fixes #68580

Change-Id: Id0879021f4640c0fefe277701d5096c649413811
Reviewed-on: https://go-review.googlesource.com/c/go/+/601115
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/601116

9 months ago[release-branch.go1.23] cmd/compile: more informative panic when importing generic...
Robert Griesemer [Wed, 24 Jul 2024 22:01:07 +0000 (15:01 -0700)]
[release-branch.go1.23] cmd/compile: more informative panic when importing generic type alias

When GOEXPERIMENT=aliastypeparams is set, type aliases may have type
parameters. The compiler export data doesn't export that type parameter
information yet, which leads to an index-out-of-bounds panic when a
client package imports a package with a general type alias and then
refers to one of the missing type parameters.

This CL detects this specific case and panics with a more informative
panic message explaining the shortcoming. The change is only in effect
if the respective GOEXPERIMENT is enabled.

Manually tested. No test addded since this is just a temporary fix
(Go 1.24 will have a complete implementation), and because the existing
testing framework doesn't easily support testing that a compilation
panics.

Together with @taking and input from @rfindley.

For #68526.

Change-Id: I24737b153a7e2f9b705cd29a5b70b2b9e808dffc
Reviewed-on: https://go-review.googlesource.com/c/go/+/601035
Reviewed-by: Tim King <taking@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
9 months ago[release-branch.go1.23] os: document CopyFS behavior for symlinks in destination
Damien Neil [Wed, 24 Jul 2024 17:29:13 +0000 (10:29 -0700)]
[release-branch.go1.23] os: document CopyFS behavior for symlinks in destination

Also clarify the permissions of created files,
and note that CopyFS will not overwrite files.

Update a few places in documentation to use 0oXXX for octal consts.

For #62484

Change-Id: I208ed2bde250304bc7fac2b93963ba57037e791e
Reviewed-on: https://go-review.googlesource.com/c/go/+/600775
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit 910e6b5fae7cbf84e4a3fcfa6739e20239080bcd)
Reviewed-on: https://go-review.googlesource.com/c/go/+/600815
Reviewed-by: Ian Lance Taylor <iant@google.com>
9 months ago[release-branch.go1.23] all: merge master (5e8a731) into release-branch.go1.23
Dmitri Shuralyov [Mon, 22 Jul 2024 18:12:36 +0000 (14:12 -0400)]
[release-branch.go1.23] all: merge master (5e8a731) into release-branch.go1.23

Merge List:

+ 2024-07-22 5e8a731665 README: fix CC BY license name
+ 2024-07-22 a799fa5189 slices: explicitly document nil and empty slice equality
+ 2024-07-22 f0de94ff12 cmd/compile: don't inline runtime functions in -d=checkptr build
+ 2024-07-19 3959d54c0b runtime: mark lockWithRankMayAcquire as nosplit
+ 2024-07-17 70491a8111 maps: document handling of non-reflexive keys
+ 2024-07-17 7321aa91c6 cmd: vendor golang.org/x/telemetry@0b706e1
+ 2024-07-17 420037b16d os: don't try to signal PID -1 on Unix
+ 2024-07-17 87abb4afb6 runtime: avoid multiple records with identical stacks from MutexProfile
+ 2024-07-17 8c88f0c736 cmd/cgo/internal/testcarchive: remove 1-minute timeout
+ 2024-07-17 fc51e5023e math/big: fix comment typo in natdiv.go
+ 2024-07-17 90c6558b6a internal/bytealg: extend memchr result correctly on wasm
+ 2024-07-16 355711821e cmd/internal/cov: close counter data files eagerly
+ 2024-07-16 f2bcab5fb3 regexp: more cross-references in docstrings
+ 2024-07-16 9915b87059 bytes: more cross-references in docstrings
+ 2024-07-16 97ccc224f1 math/big: use lists in docstrings
+ 2024-07-16 66e940b6f8 math/big: more cross-references in docstrings
+ 2024-07-16 0dae393a26 encoding/binary: use list format in docstrings
+ 2024-07-16 451a284d80 strings,bytes,regexp: use lists in Split* docstrings
+ 2024-07-16 b4a92f56ff crypto/tls: add exclude tls flags to bogo_shim_test
+ 2024-07-16 3bfbfa821f encoding/json: document compact json output in Encoder.Encode
+ 2024-07-16 d5479e197d net: document ParseIP always returns IPv6 addresses
+ 2024-07-16 5c7f541386 archive/zip: document handling of duplicate names in Writer.Create
+ 2024-07-16 6b97448132 sort: add example for Find
+ 2024-07-16 8b48290895 cmd/compile: fix recursive generic interface instantiation
+ 2024-07-15 959b3fd426 flag: add FlagSet example

Change-Id: I0e7cac2f1cef42ccf3d392c57dad793ca3b08b11

9 months agoREADME: fix CC BY license name
Will Faught [Sat, 20 Jul 2024 01:18:47 +0000 (01:18 +0000)]
README: fix CC BY license name

Change-Id: Idf3c4427426e3cb74c7749762f2b4f621cf82dba
GitHub-Last-Rev: 86f51a5d504fdb596145a41e305bea1171776daa
GitHub-Pull-Request: golang/go#68518
Reviewed-on: https://go-review.googlesource.com/c/go/+/599515
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
9 months agoslices: explicitly document nil and empty slice equality
Sean Liao [Fri, 19 Jul 2024 22:34:02 +0000 (23:34 +0100)]
slices: explicitly document nil and empty slice equality

Fixes #68472

Change-Id: I21282621d679d9e2b032256b338c0b5ff107c8f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/599816
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

9 months agocmd/compile: don't inline runtime functions in -d=checkptr build
Cherry Mui [Thu, 18 Jul 2024 18:51:34 +0000 (14:51 -0400)]
cmd/compile: don't inline runtime functions in -d=checkptr build

Runtime functions, e.g. internal/abi.NoEscape, should not be
instrumented with checkptr. But if they are inlined into a
checkptr-enabled function, they will be instrumented, and may
result in a check failure.

Let the compiler not inline runtime functions into checkptr-
enabled functions.

Also undo the change in the strings package in CL 598295, as the
compiler handles it now.

Fixes #68511.
Updates #68415.

Change-Id: I78eb380855ac9dd53c1a1a628ec0da75c3e5a1a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/599435
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
9 months agoruntime: mark lockWithRankMayAcquire as nosplit
Cuong Manh Le [Fri, 19 Jul 2024 17:55:15 +0000 (00:55 +0700)]
runtime: mark lockWithRankMayAcquire as nosplit

The function is called in nosplit context already.

Fixes #68525

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

9 months agomaps: document handling of non-reflexive keys
Sean Liao [Fri, 29 Dec 2023 20:20:03 +0000 (20:20 +0000)]
maps: document handling of non-reflexive keys

Fixes #63312

Change-Id: I7861bddcd4c6dc208b4449b923eb2785a122aadf
Reviewed-on: https://go-review.googlesource.com/c/go/+/553157
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: qiu laidongfeng2 <2645477756@qq.com>
Auto-Submit: Keith Randall <khr@golang.org>

9 months agocmd: vendor golang.org/x/telemetry@0b706e1
Rob Findley [Wed, 17 Jul 2024 20:18:06 +0000 (20:18 +0000)]
cmd: vendor golang.org/x/telemetry@0b706e1

Update x/telemetry to fix problems caused by the file rotation timer.

Commands run:
  go get golang.org/x/telemetry@0b706e1
  go mod tidy
  go mod vendor

Fixes golang/go#68497

Change-Id: I29861ec89dfaaf260eb051eb23ab9251903b5ea8
Reviewed-on: https://go-review.googlesource.com/c/go/+/598957
Reviewed-by: Michael Matloob <matloob@golang.org>
Auto-Submit: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

9 months agoos: don't try to signal PID -1 on Unix
Ian Lance Taylor [Wed, 17 Jul 2024 16:23:09 +0000 (09:23 -0700)]
os: don't try to signal PID -1 on Unix

This restores behavior that we lost in CL 588675.

Fixes #68496

Change-Id: I1740986bed647835986d54109071b7a6b37413d5
Reviewed-on: https://go-review.googlesource.com/c/go/+/599015
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>

9 months agoruntime: avoid multiple records with identical stacks from MutexProfile
Nick Ripley [Tue, 16 Jul 2024 11:15:22 +0000 (07:15 -0400)]
runtime: avoid multiple records with identical stacks from MutexProfile

When using frame pointer unwinding, we defer frame skipping and inline
expansion for call stacks until profile reporting time. We can end up
with records which have different stacks if no frames are skipped, but
identical stacks once skipping is taken into account. Returning multiple
records with the same stack (but different values) has broken programs
which rely on the records already being fully aggregated by call stack
when returned from runtime.MutexProfile. This CL addresses the problem
by handling skipping at recording time. We do full inline expansion to
correctly skip the desired number of frames when recording the call
stack, and then handle the rest of inline expansion when reporting the
profile.

The regression test in this CL is adapted from the reproducer in
https://github.com/grafana/pyroscope-go/issues/103, authored by Tolya
Korniltsev.

Fixes #67548

This reapplies CL 595966.
The original version of this CL introduced a bounds error in
MutexProfile and failed to correctly expand inlined frames from that
call. This CL applies the original CL, fixing the bounds error and
adding a test for the output of MutexProfile to ensure the frames are
expanded properly.

Change-Id: I5ef8aafb9f88152a704034065c0742ba767c4dbb
Reviewed-on: https://go-review.googlesource.com/c/go/+/598515
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
9 months agocmd/cgo/internal/testcarchive: remove 1-minute timeout
Cherry Mui [Wed, 17 Jul 2024 18:34:00 +0000 (14:34 -0400)]
cmd/cgo/internal/testcarchive: remove 1-minute timeout

The 1-minute test timeout seems a bit arbitrary. Use
internal/testenv.Command, which applies t.Deadline to subcommand.

For #67566.

Change-Id: If84c96e353bdfaf02c9b123758198e031305ae32
Reviewed-on: https://go-review.googlesource.com/c/go/+/599056
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
9 months agomath/big: fix comment typo in natdiv.go
withsky [Wed, 17 Jul 2024 12:06:34 +0000 (12:06 +0000)]
math/big: fix comment typo in natdiv.go

Comment in line 395:
[x₀ < S, so S - x₀ < 0; drop it]
Should be:
[x₀ < S, so S - x₀ > 0; drop it]

The proof is based on S - x₀ > 0, thus it's a typo of comment.

Fixes #68466

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

9 months agointernal/bytealg: extend memchr result correctly on wasm
Zxilly [Wed, 17 Jul 2024 05:34:55 +0000 (05:34 +0000)]
internal/bytealg: extend memchr result correctly on wasm

The mem address should be regarded as uint32.

Fixes #65571

Change-Id: Icee38d11f2d93eeca7d50b2e133159e321daeb90
GitHub-Last-Rev: c2568b104369bcf5c4d42c6281d235a52bb9675f
GitHub-Pull-Request: golang/go#68400
Reviewed-on: https://go-review.googlesource.com/c/go/+/597955
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

9 months agocmd/internal/cov: close counter data files eagerly
Than McIntosh [Tue, 16 Jul 2024 19:13:47 +0000 (19:13 +0000)]
cmd/internal/cov: close counter data files eagerly

When reading the counter data files from a given pod, close the
underlying *os.File immediately after each one is read, as opposed to
using a deferred close in the loop (which will close them all at the
end of the function). Doing things this way avoids running into "too
many open files" when processing large clumps of counter data files.

Fixes #68468.

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

9 months agoregexp: more cross-references in docstrings
Kir Kolyshkin [Thu, 11 Jul 2024 18:32:41 +0000 (11:32 -0700)]
regexp: more cross-references in docstrings

Change-Id: I93f617bb6d82b00d44ce9a54c2ddcc8a61209783
Reviewed-on: https://go-review.googlesource.com/c/go/+/597776
Reviewed-by: Than McIntosh <thanm@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: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 months agobytes: more cross-references in docstrings
Kir Kolyshkin [Thu, 11 Jul 2024 18:31:46 +0000 (11:31 -0700)]
bytes: more cross-references in docstrings

Change-Id: Iea0243edcf8bf73ce325695178a3ea5cfe420d31
Reviewed-on: https://go-review.googlesource.com/c/go/+/597775
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

9 months agomath/big: use lists in docstrings
Kir Kolyshkin [Thu, 11 Jul 2024 02:23:32 +0000 (19:23 -0700)]
math/big: use lists in docstrings

This looks way better than the code formatting.

Similar to CL 597656.

Change-Id: I2c8809c1d6f8a8387941567213880662ff649a73
Reviewed-on: https://go-review.googlesource.com/c/go/+/597659
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

9 months agomath/big: more cross-references in docstrings
Kir Kolyshkin [Thu, 11 Jul 2024 02:22:24 +0000 (19:22 -0700)]
math/big: more cross-references in docstrings

Change-Id: I3541859bbf3ac4f9317b82a66d21be3d5c4c5a84
Reviewed-on: https://go-review.googlesource.com/c/go/+/597658
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>

9 months agoencoding/binary: use list format in docstrings
Kir Kolyshkin [Thu, 11 Jul 2024 02:07:05 +0000 (19:07 -0700)]
encoding/binary: use list format in docstrings

This looks way better than the code formatting.

Similar to CL 597656.

Change-Id: If404c952ece384aea096f2394bd475a601627a79
Reviewed-on: https://go-review.googlesource.com/c/go/+/597657
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

9 months agostrings,bytes,regexp: use lists in Split* docstrings
Kir Kolyshkin [Thu, 11 Jul 2024 01:46:37 +0000 (18:46 -0700)]
strings,bytes,regexp: use lists in Split* docstrings

This looks better than the default of using a code block.
While at it, fix punctuation.

Change-Id: I86abca4da1e9999b7e9043e615ad0988d35a5a46
Reviewed-on: https://go-review.googlesource.com/c/go/+/597656
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

9 months agocrypto/tls: add exclude tls flags to bogo_shim_test
Clide Stefani [Wed, 26 Jun 2024 20:29:01 +0000 (16:29 -0400)]
crypto/tls: add exclude tls flags to bogo_shim_test

The existing implementation of bogo_shim_test does not support tests
that use the -no-tls1, -no-tls11, or -no-tls12 flags.
This change adds support for these flags.

Updates #51434

Change-Id: I43eaea9f5ec6da6811b150630a7dde24d108017e
Reviewed-on: https://go-review.googlesource.com/c/go/+/595775
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Russell Webb <russell.webb@protonmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
9 months agoencoding/json: document compact json output in Encoder.Encode
Sean Liao [Fri, 12 Jul 2024 19:03:08 +0000 (20:03 +0100)]
encoding/json: document compact json output in Encoder.Encode

Using the same wording as Compact.

Fixes #67943

Change-Id: I578874f3e917bba1634dd988895e622a5ac78c74
Reviewed-on: https://go-review.googlesource.com/c/go/+/597976
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
9 months agonet: document ParseIP always returns IPv6 addresses
Sean Liao [Fri, 12 Jul 2024 20:03:38 +0000 (21:03 +0100)]
net: document ParseIP always returns IPv6 addresses

Fixes #65131

Change-Id: I050c6459a8e0a6c99425759d3131cf775b05aac9
Reviewed-on: https://go-review.googlesource.com/c/go/+/598076
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
9 months agoarchive/zip: document handling of duplicate names in Writer.Create
Sean Liao [Fri, 12 Jul 2024 19:51:45 +0000 (20:51 +0100)]
archive/zip: document handling of duplicate names in Writer.Create

Fixes #66810

Change-Id: I6a7848dce245ae14941d61d2f78abaf0dc5c1247
Reviewed-on: https://go-review.googlesource.com/c/go/+/597978
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

9 months agosort: add example for Find
cui fliter [Sun, 4 Feb 2024 13:08:40 +0000 (21:08 +0800)]
sort: add example for Find

Change-Id: Id7b12356dd2114dfbab260cff00114b6055ee011
Reviewed-on: https://go-review.googlesource.com/c/go/+/561175
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: shuang cui <imcusg@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

9 months agocmd/compile: fix recursive generic interface instantiation
Cuong Manh Le [Wed, 31 Jan 2024 07:47:40 +0000 (14:47 +0700)]
cmd/compile: fix recursive generic interface instantiation

When shapifying recursive instantiated types, the compiler ends up
leaving the type as-is if it already has been a shape type. However, if
both of type arguments are interfaces, and one of them is a recursive
one, it ends up being shaped as-is, while the other is shaped to its
underlying, causing mismatch in function signature.

Fixing this by shapifying an interface type as-is, if it is fully
instantiated and already been a shape type.

Fixes #65362
Fixes #66663

Change-Id: I839d266e0443b41238b1b7362aca09adc0177362
Reviewed-on: https://go-review.googlesource.com/c/go/+/559656
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
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@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
9 months ago[release-branch.go1.23] go1.23rc2 go1.23rc2
Gopher Robot [Tue, 16 Jul 2024 15:04:50 +0000 (15:04 +0000)]
[release-branch.go1.23] go1.23rc2

Change-Id: I73a3f2e680a84aa698c6f64b1e924bb1b9a85a89
Reviewed-on: https://go-review.googlesource.com/c/go/+/598555
TryBot-Bypass: Carlos Amedee <carlos@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Auto-Submit: Gopher Robot <gobot@golang.org>

9 months agoflag: add FlagSet example
Miki Tebeka [Wed, 6 Dec 2023 13:33:02 +0000 (13:33 +0000)]
flag: add FlagSet example

Add an example for using FlagSet.

Fixes #36307

Change-Id: I0bf5805bd836a4f2e9632aafe22dc3eeb1164dcd
GitHub-Last-Rev: 79e53040cbc2658a71385b644107f8ea54132c99
GitHub-Pull-Request: golang/go#64443
Reviewed-on: https://go-review.googlesource.com/c/go/+/545736
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Christopher Taylor <ccmtaylor@gmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 months ago[release-branch.go1.23] all: merge master (6948b4d) into release-branch.go1.23
Cherry Mui [Mon, 15 Jul 2024 20:40:36 +0000 (16:40 -0400)]
[release-branch.go1.23] all: merge master (6948b4d) into release-branch.go1.23

Merge List:

+ 2024-07-15 6948b4df8c Revert "runtime: avoid multiple records with identical stacks from MutexProfile"

Change-Id: I94d1f445b0304eb4355ef6e91bf9f8585abfe0f8

9 months agoRevert "runtime: avoid multiple records with identical stacks from MutexProfile"
Cherry Mui [Mon, 15 Jul 2024 19:49:44 +0000 (19:49 +0000)]
Revert "runtime: avoid multiple records with identical stacks from MutexProfile"

This reverts CL 595966.

Reason for revert: This CL contains a bug. See the comment in https://go-review.googlesource.com/c/go/+/595966/8#message-57f4c1f9570b5fe912e06f4ae3b52817962533c0

Change-Id: I48030907ded173ae20a8965bf1b41a713dd06059
Reviewed-on: https://go-review.googlesource.com/c/go/+/598219
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
9 months ago[release-branch.go1.23] all: merge master (8f1ec59) into release-branch.go1.23
Cherry Mui [Mon, 15 Jul 2024 17:23:33 +0000 (13:23 -0400)]
[release-branch.go1.23] all: merge master (8f1ec59) into release-branch.go1.23

Merge List:

+ 2024-07-15 8f1ec59bdb strings: re-introduce noescape wrapper
+ 2024-07-15 5d36bc18d5 net/http: document io.Seeker requirement for fs.FS arguments
+ 2024-07-12 071b8d51c1 cmd: vendor golang.org/x/telemetry@268b4a8ec2d7
+ 2024-07-12 4e77872d16 go/types: fix assertion failure when range over int is not permitted
+ 2024-07-12 8bc32ab6b1 os: clean up after TestIssue60181
+ 2024-07-11 b31e9a63a4 unsafe: say "functions like syscall.Syscall", not only Syscall
+ 2024-07-11 a71bb570d0 all: make struct comments match struct names
+ 2024-07-11 611f18c4e9 strings: more cross-references in docstrings
+ 2024-07-11 08a6e080ca database/sql/driver: fix name in comment
+ 2024-07-11 dfaaa91f05 os: clarify that IsNotExist, IsExist, IsPermission and IsTimeout work with nil errors
+ 2024-07-10 5881d857c5 crypto/tls: add support for -expect-no-hrr to bogo_shim_test
+ 2024-07-10 b3040679ad math: remove riscv64 assembly implementations of rounding
+ 2024-07-10 70e453b436 context: handle nil values for valueCtx.String()
+ 2024-07-09 183a40db6d runtime: avoid multiple records with identical stacks from MutexProfile
+ 2024-07-09 e89e880eac crypto/tls: add support for -reject-alpn and -decline-alpn flags to bogo_shim_test
+ 2024-07-09 73186ba002 crypto/internal/cryptotest: add common tests for the hash.Hash interface
+ 2024-07-08 87ec2c959c testing: remove call to os.Exit in documentation for TestMain
+ 2024-07-08 6d89b38ed8 unsafe: clarify when String bytes can be modified
+ 2024-07-07 5565462a86 cmd/dist: remove iter,slices,maps test on GOEXPERIMENT=rangefunc
+ 2024-07-07 b43d6c57de io: add test for Pipe constructor allocations
+ 2024-07-07 d0146bd85b os/exec: only use cachedLookExtensions if Cmd.Path is unmodified
+ 2024-07-05 ad77cefeb2 cmd/compile: correct RewriteMultiValueCall fatal message
+ 2024-07-05 be152920b9 cmd/compile: fix ICE when compiling global a, b = f()
+ 2024-07-03 82c14346d8 cmd/link: don't disable memory profiling when pprof.WriteHeapProfile is used
+ 2024-07-03 7d19d508a9 cmd/cgo: read CGO_LDFLAGS environment variable
+ 2024-07-03 5f50b1e3bf cmd/compile: fix mis-compilation when switching over channels
+ 2024-07-03 71f9dbb1e4 cmd/compile: emit error message on mismatch import path
+ 2024-07-03 148755a27b cmd/link: document -checklinkname option
+ 2024-07-02 f12ac5be70 time: fix time zone parsing when format includes time zone seconds
+ 2024-07-02 09aeb6e33a os: add TODO about removing test exception
+ 2024-07-01 94982a0782 cmd/go/internal/workcmd: remove a potentially confusing statement
+ 2024-07-01 f71c00b616 cmd/link: align .reloc block starts by 32 bits for PE target
+ 2024-07-01 d3c93f2f00 cmd/go: update go clean help message
+ 2024-07-01 cdbf5f2f7e sync: refer to Locker interface methods in RWMutex.RLocker doc
+ 2024-07-01 c33144c47c runtime: fix nil pointer in TestGoroutineParallelism2 when offline
+ 2024-06-28 82c371a307 cmd/compile: drop internal range-over-func vars from DWARF output
+ 2024-06-28 773767def0 net/http: avoid appending an existing trailing slash to path again
+ 2024-06-28 7f90b960a9 cmd/compile: don't elide zero extension on top of signed values
+ 2024-06-27 ea537cca31 cmd/go/internal/help: add documentation for language version downgrading
+ 2024-06-27 b0927fdd49 slices: update docs for All, Backward, Values
+ 2024-06-26 5a18e79687 cmd/link: don't skip code sign even if dsymutil didn't generate a file
+ 2024-06-26 5f319b7507 cmd/link: don't let dsymutil delete our temp directory
+ 2024-06-26 a2e90be996 os: rewrite TestChtimesWithZeroTimes
+ 2024-06-25 90bcc552c0 crypto/tls: apply QUIC session event flag to QUICResumeSession events
+ 2024-06-25 b1fd047508 cmd/internal/obj/arm64: fix return with register
+ 2024-06-25 b3b4556c24 cmd/compile: update README to reflect dead code elimination changes
+ 2024-06-24 68315bc8ce cmd: run go mod tidy after CL 593684
+ 2024-06-24 f214a76075 cmd/vendor: vendor x/telemetry@38a4430
+ 2024-06-24 29b1a6765f net/http: document that Request.Clone does not deep copy Body
+ 2024-06-24 cf54a3d114 crypto/tls: replay test recordings without network
+ 2024-06-24 b98803e8e5 os: TestChtimes: separate hasNoatime
+ 2024-06-24 0def9d5c02 cmd/internal/obj/arm64: Enable arm64 assembler tests for cross-compiler builds
+ 2024-06-24 085cf0fcdc net/netip: add test that Compare and reflect.DeepEqual match
+ 2024-06-24 740043f516 net/netip: unexport fields of addrDetail
+ 2024-06-23 e8ee1dc4f9 cmd/link/internal/ld: handle "\r" in MinGW "--print-prog-name" output
+ 2024-06-22 44f1870666 cmd/link: handle dynamic import variables on Darwin in plugin mode
+ 2024-06-21 0af2148fdc cmd: vendor golang.org/x/telemetry@a740542
+ 2024-06-21 cb3b34349b doc/next: delete
+ 2024-06-21 d79c350916 cmd/internal: separate counter package from telemetry package
+ 2024-06-21 52ce25b44e cmd/vendor: pull in golang.org/x/telemetry@b4de734
+ 2024-06-21 fed2c11d67 iter: minor doc comment updates
+ 2024-06-21 d73a8a206a cmd/cgo: fail on v, err := C.fn when fn is a builtin function
+ 2024-06-21 1b4f1dc95d os: improve newFile, rm newDir
+ 2024-06-21 72e2220b50 encoding/json: clarify the map's key type for Unmarshal
+ 2024-06-21 e9a306e004 types2, go/types: correct NewTypeParam documentation
+ 2024-06-21 6fea409424 text/template/parse: fix handling of assignment/declaration in PipeNode.String
+ 2024-06-21 d67839f58a crypto/tls: add support for -expect-version to bogo_shim_test
+ 2024-06-21 201129414f sync/atomic: correct result names for Or methods
+ 2024-06-21 20b79fd577 time: provide non-default metric for asynctimerchan
+ 2024-06-20 9d33956503 internal/godebugs: fix old value for httpservecontentkeepheaders
+ 2024-06-20 477ad7dd51 cmd/compile: support generic alias type
+ 2024-06-18 4f77a83589 internal/syscall/unix: fix UTIME_OMIT for dragonfly

Change-Id: I3864b03b8c377e8fe82014eee96dc7b77aea64e2

9 months agostrings: re-introduce noescape wrapper
Cuong Manh Le [Mon, 15 Jul 2024 16:20:52 +0000 (23:20 +0700)]
strings: re-introduce noescape wrapper

CL 573955 added internal/abi:NoEscape function, and use it in strings
builder copyCheck code.

However, internal/abi is a runtime package, which can not be built with
-d=checkptr flag yet. This causes incorrect inlining decision, since
NoEscape must not be inlined when -d=checkptr is used.

Fixing this by re-introducing noescape wrapper.

Fixes #68415

Change-Id: I776cab4c9e9e4b3e58162dcce6ec025cb366bdee
Reviewed-on: https://go-review.googlesource.com/c/go/+/598295
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>

9 months agonet/http: document io.Seeker requirement for fs.FS arguments
Sean Liao [Fri, 12 Jul 2024 19:42:50 +0000 (20:42 +0100)]
net/http: document io.Seeker requirement for fs.FS arguments

Using the same wording as http.FS, even though it's not strictly
required if a content type can be determined by file extension.

Fixes #66877
Updates #44553

Change-Id: I7b70c10909bdd289a57d1998a565262b8aaf2dd2
Reviewed-on: https://go-review.googlesource.com/c/go/+/597977
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

9 months agocmd: vendor golang.org/x/telemetry@268b4a8ec2d7
Rob Findley [Fri, 12 Jul 2024 22:03:43 +0000 (22:03 +0000)]
cmd: vendor golang.org/x/telemetry@268b4a8ec2d7

Commands run, from cmd:
  go get golang.org/x/telemetry@268b4a8ec2d7
  go mod tidy
  go mod vendor

Commands run, from std (to keep versions consistent):
  go get golang.org/x/sys@v0.22.0
  go mod tidy
  go mod vendor

Fixes #67617

Change-Id: I65e759c9b03443619a2a7acbeba53694ff5bbf6a
Reviewed-on: https://go-review.googlesource.com/c/go/+/597896
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

9 months agogo/types: fix assertion failure when range over int is not permitted
Tim King [Tue, 9 Jul 2024 21:01:56 +0000 (14:01 -0700)]
go/types: fix assertion failure when range over int is not permitted

Fixes an assertion failure in Checker.rangeStmt that range over int
only has a key type and no value type. When allowVersion failed,
rangeKeyVal returns Typ[Invalid] for the value instead of nil. When
Config.Error != nil, rangeStmt proceeded. The check for rhs[1]==nil
was not enough to catch this case. It must also check rhs[1]==

Updates #68334

Change-Id: Iffa1b2f7b6a94570ec50b8c6603e727a45ba3357
Reviewed-on: https://go-review.googlesource.com/c/go/+/597356
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

9 months agoos: clean up after TestIssue60181
Joel Sing [Wed, 10 Jul 2024 13:20:11 +0000 (23:20 +1000)]
os: clean up after TestIssue60181

This test currently leaves two temp files lying around - ensure these
are created in the current working directory (a temp dir) so that they
get cleaned up when the test is complete.

Change-Id: I9a29e24a2cd601de3ab39c421830ee2bcda76516
Reviewed-on: https://go-review.googlesource.com/c/go/+/597317
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

9 months agounsafe: say "functions like syscall.Syscall", not only Syscall
Ian Lance Taylor [Sat, 6 Jul 2024 21:09:26 +0000 (14:09 -0700)]
unsafe: say "functions like syscall.Syscall", not only Syscall

Fixes #68301

Change-Id: I9d7f623370705ab2ad4c49489b5a89162467f22a
Reviewed-on: https://go-review.googlesource.com/c/go/+/596936
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

9 months agoall: make struct comments match struct names
cuishuang [Thu, 4 Jul 2024 06:10:55 +0000 (14:10 +0800)]
all: make struct comments match struct names

Change-Id: I011f66854a9af5f3baa20abebd4b315c15db571f
Reviewed-on: https://go-review.googlesource.com/c/go/+/596715
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: shuang cui <imcusg@gmail.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

9 months agostrings: more cross-references in docstrings
Kir Kolyshkin [Thu, 11 Jul 2024 01:37:00 +0000 (18:37 -0700)]
strings: more cross-references in docstrings

This amends CL 534775.

Change-Id: I25a217da51853ec29106998e19e9386d756902fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/597655
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

9 months agodatabase/sql/driver: fix name in comment
Jonathan Hall [Wed, 10 Jan 2024 20:23:25 +0000 (21:23 +0100)]
database/sql/driver: fix name in comment

DefaultValueConverter => DefaultParameterConverter

Change-Id: I0e726cfdbf21a5e00928899d1fd9144f89dcb805
Reviewed-on: https://go-review.googlesource.com/c/go/+/555235
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Shay Nehmad <dude500@gmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>

9 months agoos: clarify that IsNotExist, IsExist, IsPermission and IsTimeout work with nil errors
Diogo Pinela [Thu, 28 Mar 2019 20:35:28 +0000 (20:35 +0000)]
os: clarify that IsNotExist, IsExist, IsPermission and IsTimeout work with nil errors

Referring to these functions' parameter as "*the* error" could be taken
to imply that a non-nil error from elsewhere is expected; referring to
it as "its argument" avoids that ambiguity.

Fixes #31065

Change-Id: I117892dd53fff6f92d11a416e4abedee5d2f9337
Reviewed-on: https://go-review.googlesource.com/c/go/+/170077
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
9 months agocrypto/tls: add support for -expect-no-hrr to bogo_shim_test
Clide Stefani [Tue, 25 Jun 2024 15:46:39 +0000 (11:46 -0400)]
crypto/tls: add support for -expect-no-hrr to bogo_shim_test

The existing implementation of bogo_shim_test does not support tests
that use the expect-no-hrr flag. This change adds support for this flag.

Updates #51434

Change-Id: Iadb38fc2262783cab144a7b52904d0443e7fc2c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/594835
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Russell Webb <russell.webb@protonmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>

9 months agomath: remove riscv64 assembly implementations of rounding
Jorropo [Sat, 6 Jul 2024 02:48:04 +0000 (04:48 +0200)]
math: remove riscv64 assembly implementations of rounding

Fixes #68322

This reverts commit ad377e906a8ee6f27545d83de280206dacec1e58.

Change-Id: Ifa4811e2c679d789cc830dbff5e50301410e24d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/596516
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Commit-Queue: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
9 months agocontext: handle nil values for valueCtx.String()
Sean Liao [Tue, 9 Jul 2024 19:24:34 +0000 (20:24 +0100)]
context: handle nil values for valueCtx.String()

Fixes #68356

Change-Id: I57dc089a99f545e29a6759a8db5e28fabb6d1a61
Reviewed-on: https://go-review.googlesource.com/c/go/+/597415
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

9 months agoruntime: avoid multiple records with identical stacks from MutexProfile
Nick Ripley [Tue, 2 Jul 2024 16:53:36 +0000 (12:53 -0400)]
runtime: avoid multiple records with identical stacks from MutexProfile

When using frame pointer unwinding, we defer frame skipping and inline
expansion for call stacks until profile reporting time. We can end up
with records which have different stacks if no frames are skipped, but
identical stacks once skipping is taken into account. Returning multiple
records with the same stack (but different values) has broken programs
which rely on the records already being fully aggregated by call stack
when returned from runtime.MutexProfile. This CL addresses the problem
by handling skipping at recording time. We do full inline expansion to
correctly skip the desired number of frames when recording the call
stack, and then handle the rest of inline expansion when reporting the
profile.

The regression test in this CL is adapted from the reproducer in
https://github.com/grafana/pyroscope-go/issues/103, authored by Tolya
Korniltsev.

Fixes #67548

Co-Authored-By: Tolya Korniltsev <korniltsev.anatoly@gmail.com>
Change-Id: I6a42ce612377f235b2c8c0cec9ba8e9331224b84
Reviewed-on: https://go-review.googlesource.com/c/go/+/595966
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Reviewed-by: Felix Geisendörfer <felix.geisendoerfer@datadoghq.com>
9 months agocrypto/tls: add support for -reject-alpn and -decline-alpn flags to bogo_shim_test
Clide Stefani [Tue, 11 Jun 2024 18:42:13 +0000 (14:42 -0400)]
crypto/tls: add support for -reject-alpn and -decline-alpn flags to bogo_shim_test

The existing implementation of bogo_shim_test does not support tests
which use the reject-alpn or the decline-alpn flag.
This change adds support for these flags in bogo_shim_test.

Updates #51434
Updates #46310

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Change-Id: I3ff23ff4edd8f4c6c37ee6c9f2ee4689066c4e00
Reviewed-on: https://go-review.googlesource.com/c/go/+/592198
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

9 months agocrypto/internal/cryptotest: add common tests for the hash.Hash interface
Manuel Sabin [Fri, 7 Jun 2024 18:50:42 +0000 (14:50 -0400)]
crypto/internal/cryptotest: add common tests for the hash.Hash interface

This CL creates the cryptotest package to host a suite of tests
for interfaces that are implemented in the crypto package.  This CL
includes a set of tests for the hash.Hash interface, and calls these tests from the tests of hash.Hash implementations in crypto/.

Tests for other interfaces will be included in subsequent CLs.

Updates #25309

Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
Reviewed-on: https://go-review.googlesource.com/c/go/+/592855
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Russell Webb <russell.webb@protonmail.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>

9 months agotesting: remove call to os.Exit in documentation for TestMain
Julian Dax [Sun, 7 Jul 2024 21:41:02 +0000 (23:41 +0200)]
testing: remove call to os.Exit in documentation for TestMain

In the example for the TestMain function, os.Exit was called explicitly,
which is no longer necessary since Go 1.15 (see change #219639).

Updates #34129

Change-Id: Ia8021de0d5699742adbb7ab6d28b11c841e596dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/596977
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

9 months agounsafe: clarify when String bytes can be modified
Ian Lance Taylor [Sat, 6 Jul 2024 21:42:16 +0000 (14:42 -0700)]
unsafe: clarify when String bytes can be modified

They can be modified when the string returned by String no longer exists.

Fixes #68300

Change-Id: I526a068151f7aad1ab6827504b51a84e7399cafe
Reviewed-on: https://go-review.googlesource.com/c/go/+/596955
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Commit-Queue: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

9 months agocmd/dist: remove iter,slices,maps test on GOEXPERIMENT=rangefunc
qiulaidongfeng [Sat, 6 Jul 2024 23:03:27 +0000 (23:03 +0000)]
cmd/dist: remove iter,slices,maps test on GOEXPERIMENT=rangefunc

In go1.23, don't need use GOEXPERIMENT=rangefunc enable range-over-func.

Change-Id: I88b799c4b38c8fbeed8d9f912a0c3c6c45c80e9d
GitHub-Last-Rev: 64fd4524f1d2f66049fdce1f68912742c98fb8d9
GitHub-Pull-Request: golang/go#68325
Reviewed-on: https://go-review.googlesource.com/c/go/+/596517
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

9 months agoio: add test for Pipe constructor allocations
Cuong Manh Le [Fri, 24 May 2024 16:41:22 +0000 (23:41 +0700)]
io: add test for Pipe constructor allocations

Updates #67633

Change-Id: If3da9317ba36cb8a7868db94b45c402e1793e018
Reviewed-on: https://go-review.googlesource.com/c/go/+/588219
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Mateusz Poliwczak <mpoliwczak34@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
9 months agoos/exec: only use cachedLookExtensions if Cmd.Path is unmodified
Dmitri Shuralyov [Thu, 4 Jul 2024 22:07:45 +0000 (18:07 -0400)]
os/exec: only use cachedLookExtensions if Cmd.Path is unmodified

Caching the invocation of lookExtensions on an absolute path in Command
and reusing the cached result in Start is only viable if Cmd.Path isn't
set to a different value after Command returns.

For #66586.
Fixes #68314.

Change-Id: I57007850aca2011b11344180c00faded737617b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/596875
Reviewed-by: qiu laidongfeng2 <2645477756@qq.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
9 months agocmd/compile: correct RewriteMultiValueCall fatal message
Cuong Manh Le [Wed, 3 Jul 2024 04:46:46 +0000 (11:46 +0700)]
cmd/compile: correct RewriteMultiValueCall fatal message

The function name was changed in CL 331470.

Change-Id: I6f41866a9c5ccce594dd84185ebfc1c5af280184
Reviewed-on: https://go-review.googlesource.com/c/go/+/596395
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
9 months agocmd/compile: fix ICE when compiling global a, b = f()
Cuong Manh Le [Tue, 2 Jul 2024 10:17:39 +0000 (17:17 +0700)]
cmd/compile: fix ICE when compiling global a, b = f()

CL 327651 rewrites a, b = f() to use temporaries when types are not
identical. That would leave OAS2 node appears in body of init function
for global variables initialization. The staticinit pass is not updated
to handle OAS2 node, causing ICE when compiling global variables.

To fix this, handle OAS2 nodes like other OAS2*, since they mostly
necessitate dynamic execution anyway.

Fixes #68264

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

10 months agocmd/link: don't disable memory profiling when pprof.WriteHeapProfile is used
Cherry Mui [Wed, 3 Jul 2024 18:14:34 +0000 (14:14 -0400)]
cmd/link: don't disable memory profiling when pprof.WriteHeapProfile is used

We have an optimization that if the memory profile is not consumed
anywhere, we set the memory profiling rate to 0 to disable the
"background" low-rate profiling. We detect whether the memory
profile is used by checking whether the runtime.MemProfile function
is reachable at link time. Previously, all APIs that access the
memory profile go through runtime.MemProfile. But the code was
refactored in CL 572396, and now the legacy entry point
WriteHeapProfile uses pprof_memProfileInternal without going
through runtime.MemProfile. In fact, even with the recommended
runtime/pprof.Profile API (pprof.Lookup or pprof.Profiles),
runtime.MemProfile is only (happen to be) reachable through
countHeap.

Change the linker to check runtime.memProfileInternal instead,
which is on all code paths that retrieve the memory profile. Add
a test case for WriteHeapProfile, so we cover all entry points.

Fixes #68136.

Change-Id: I075c8d45c95c81825a1822f032e23107aea4303c
Reviewed-on: https://go-review.googlesource.com/c/go/+/596538
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

10 months agocmd/cgo: read CGO_LDFLAGS environment variable
Ian Lance Taylor [Wed, 3 Jul 2024 18:20:54 +0000 (11:20 -0700)]
cmd/cgo: read CGO_LDFLAGS environment variable

For #66456 we changed from the CGO_LDFLAGS environment variable to
the -ldflags option. This broke Bazel, which uses CGO_LDFLAGS.
So restore reading CGO_LDFLAGS for now.

For #66456

Change-Id: Iebdd8bde1c7c18da09c6370e284c7ac7fa08fc54
Reviewed-on: https://go-review.googlesource.com/c/go/+/596615
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
10 months agocmd/compile: fix mis-compilation when switching over channels
Cuong Manh Le [Mon, 24 Jun 2024 19:35:19 +0000 (02:35 +0700)]
cmd/compile: fix mis-compilation when switching over channels

CL 418101 changes Unified IR writer to force mixed tag/case to have
common type, emitting the implicit conversion if any of the case values
are not assignable to the tag value's type.

However, the Go spec definition of equality is non-transitive for
channels stored in interfaces, causing incorrect behavior with channel
values comparison.

To fix it, don't emit the implicit conversions if tag type is channel.

Fixes #67190

Change-Id: I9a29d9ce3c7978f0689e9502ba6f15660c763d16
Reviewed-on: https://go-review.googlesource.com/c/go/+/594575
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
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>
Reviewed-by: Than McIntosh <thanm@google.com>
10 months agocmd/compile: emit error message on mismatch import path
Cuong Manh Le [Wed, 3 Jul 2024 06:13:05 +0000 (13:13 +0700)]
cmd/compile: emit error message on mismatch import path

Fixes #54542

Change-Id: I16cfb84fc54892923106d0a6f0b3ba810886d077
Reviewed-on: https://go-review.googlesource.com/c/go/+/596396
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
10 months agocmd/link: document -checklinkname option
Ian Lance Taylor [Tue, 2 Jul 2024 18:44:43 +0000 (11:44 -0700)]
cmd/link: document -checklinkname option

For #67401

Change-Id: I04bff1c942a4033325450c0b7dddc7980f3373cc
Reviewed-on: https://go-review.googlesource.com/c/go/+/596216
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
10 months agotime: fix time zone parsing when format includes time zone seconds
Darin Krauss [Mon, 1 Jul 2024 17:25:28 +0000 (13:25 -0400)]
time: fix time zone parsing when format includes time zone seconds

The current implementation fails to parse a time string with a "Z"
time zone using a time format that includes time zone seconds. This
fix correctly parses the "Z" time zone for any Z-base time format
that includes seconds (i.e. "Z070000" or "Z07:00:00").

Fixes #68263

Change-Id: Idf8fa06b5f96383f050c4ffbd2bc5804fd408650
Reviewed-on: https://go-review.googlesource.com/c/go/+/595897
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
10 months agoos: add TODO about removing test exception
Kir Kolyshkin [Mon, 1 Jul 2024 19:41:56 +0000 (12:41 -0700)]
os: add TODO about removing test exception

TestChtimesOmit excludes the failure on DragonFly BSD when both
atime and mtime are omitted.

The relevant Dragonfly BSD bug is now fixed in git (see [1]).

Add a TODO comment to remove the exclusion from the test once
the fix is generally available. This comment also addresses the
question why the exception exists.

Amends CL 591535.

[1]: https://github.com/DragonFlyBSD/DragonFlyBSD/commit/c7c71870ed0

Change-Id: I3b53582301d44feb76b53788aa337c380ba82592
Reviewed-on: https://go-review.googlesource.com/c/go/+/595958
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
10 months agocmd/go/internal/workcmd: remove a potentially confusing statement
Michael Matloob [Mon, 1 Jul 2024 18:13:21 +0000 (14:13 -0400)]
cmd/go/internal/workcmd: remove a potentially confusing statement

A statement in the go work use docs that was meant to clarify that go
work use would clean up use statements where the directories did not
exist ended up causing confusion.

Remove that statement for now. We might want to add something back in
the future.

For #68245

Change-Id: I7f6646b5dd05c18aa15e0e54f2816753f318404e
Reviewed-on: https://go-review.googlesource.com/c/go/+/595536
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
10 months agocmd/link: align .reloc block starts by 32 bits for PE target
Than McIntosh [Mon, 1 Jul 2024 16:11:33 +0000 (16:11 +0000)]
cmd/link: align .reloc block starts by 32 bits for PE target

Tweak the code that emits the PE ".reloc" section on Windows to ensure
that each relocation block is 32-bit aligned, which is required by the
PE standard.

Fixes #68260.

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

10 months agocmd/go: update go clean help message
Mohamed Yousif [Mon, 24 Jun 2024 16:14:03 +0000 (16:14 +0000)]
cmd/go: update go clean help message

Update the help message for the go clean command to include
the correct usage and flags for better clarity.

This change follows instructions by Ian on this thread <https://groups.google.com/g/golang-nuts/c/VENQ0fqLCSc/m/qO8EuawVBwAJ?pli=1>.

Change-Id: Ia509a38ee9ec7c31d384c3563535c5e3ccd9a9ce
GitHub-Last-Rev: 3048b2e4bd10a8d25da479f96c9d90ecb3c63082
GitHub-Pull-Request: golang/go#68135
Reviewed-on: https://go-review.googlesource.com/c/go/+/593639
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Commit-Queue: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
10 months agosync: refer to Locker interface methods in RWMutex.RLocker doc
Dmitri Shuralyov [Sat, 29 Jun 2024 20:35:40 +0000 (20:35 +0000)]
sync: refer to Locker interface methods in RWMutex.RLocker doc

The methods being implemented are part of the Locker interface,
not the RWMutex struct.

Fixes #68250.

Change-Id: I609c4d5c44e90a12914a8678971ba295519cc265
Reviewed-on: https://go-review.googlesource.com/c/go/+/595875
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
10 months agoruntime: fix nil pointer in TestGoroutineParallelism2 when offline
Tom Levy [Mon, 13 May 2024 04:10:34 +0000 (04:10 +0000)]
runtime: fix nil pointer in TestGoroutineParallelism2 when offline

Previously, the test would crash when running on a computer without an
internet connection, e.g. in airplane mode (stack trace below).

The bug was that the condition was inverted. The code tried to close
the listener if `err != nil` (that is, if net.Listen() failed). But if
Listen() failed then there is no listener to close! The listener
should only be closed if Listen() succeeded.

Here is the stack trace from `go test runtime` when offline:

```
--- FAIL: TestGoroutineParallelism2 (0.16s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7bdaa1]

goroutine 3858 gp=0xc000185180 m=5 mp=0xc000100008 [running]:
panic({0x854960?, 0xbf70b0?})
<go>/src/runtime/panic.go:778 +0x168 fp=0xc0000afad8 sp=0xc0000afa28 pc=0x441bc8
testing.tRunner.func1.2({0x854960, 0xbf70b0})
<go>/src/testing/testing.go:1632 +0x230 fp=0xc0000afb88 sp=0xc0000afad8 pc=0x524090
testing.tRunner.func1()
<go>/src/testing/testing.go:1635 +0x35e fp=0xc0000afd18 sp=0xc0000afb88 pc=0x523a7e
panic({0x854960?, 0xbf70b0?})
<go>/src/runtime/panic.go:759 +0x132 fp=0xc0000afdc8 sp=0xc0000afd18 pc=0x441b92
runtime.panicmem(...)
<go>/src/runtime/panic.go:261
runtime.sigpanic()
<go>/src/runtime/signal_unix.go:900 +0x359 fp=0xc0000afe28 sp=0xc0000afdc8 pc=0x483c79
runtime_test.testGoroutineParallelism2(0x522e13?, 0x0, 0x1)
<go>/src/runtime/proc_test.go:204 +0x221 fp=0xc0000aff50 sp=0xc0000afe28 pc=0x7bdaa1
runtime_test.TestGoroutineParallelism2(0xc000221520)
<go>/src/runtime/proc_test.go:151 +0x30 fp=0xc0000aff70 sp=0xc0000aff50 pc=0x7bd850
testing.tRunner(0xc000221520, 0x8fed88)
<go>/src/testing/testing.go:1690 +0xf4 fp=0xc0000affc0 sp=0xc0000aff70 pc=0x523674
testing.(*T).Run.gowrap1()
<go>/src/testing/testing.go:1743 +0x25 fp=0xc0000affe0 sp=0xc0000affc0 pc=0x524665
runtime.goexit({})
<go>/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0000affe8 sp=0xc0000affe0 pc=0x487a41
created by testing.(*T).Run in goroutine 1
<go>/src/testing/testing.go:1743 +0x390
```

Change-Id: I48983fe21b3360ea9d0182c4a3b509801257027b
Reviewed-on: https://go-review.googlesource.com/c/go/+/584436
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Keith Randall <khr@google.com>
10 months agocmd/compile: drop internal range-over-func vars from DWARF output
Alessandro Arzilli [Mon, 24 Jun 2024 13:53:55 +0000 (15:53 +0200)]
cmd/compile: drop internal range-over-func vars from DWARF output

Drops internal range-over-func variables from the DWARF output
(excluding #yield which is used by Delve).

Fixes #68238

Change-Id: Ic035e37ca3560347276cdc3b469fd564da33f4f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/594257
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Auto-Submit: Hyang-Ah Hana Kim <hyangah@gmail.com>

10 months agonet/http: avoid appending an existing trailing slash to path again
Jes Cok [Tue, 25 Jun 2024 17:35:13 +0000 (01:35 +0800)]
net/http: avoid appending an existing trailing slash to path again

This CL is similar to CL 562557, and it takes over CL 594175.

While here, unrelatedly remove mapKeys function, use slices.Sorted(maps.Keys(ms))
to simplify code.

Fixes #67657

Change-Id: Id8b99216f87a6dcfd6d5fa61407b515324c79112
Reviewed-on: https://go-review.googlesource.com/c/go/+/594737
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Joedian Reid <joedian@google.com>
10 months agocmd/compile: don't elide zero extension on top of signed values
Keith Randall [Fri, 28 Jun 2024 03:45:22 +0000 (20:45 -0700)]
cmd/compile: don't elide zero extension on top of signed values

v = ... compute some value, which zeros top 32 bits ...
w = zero-extend v

We want to remove the zero-extension operation, as it doesn't do anything.
But if v is typed as a signed value, and it gets spilled/restored, it
might be re-sign-extended upon restore. So the zero-extend isn't actually
a NOP when there might be calls or other reasons to spill in between v and w.

Fixes #68227

Change-Id: I3b30b8e56c7d70deac1fb09d2becc7395acbadf8
Reviewed-on: https://go-review.googlesource.com/c/go/+/595675
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Joedian Reid <joedian@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
10 months agocmd/go/internal/help: add documentation for language version downgrading
Michael Matloob [Thu, 27 Jun 2024 15:16:30 +0000 (11:16 -0400)]
cmd/go/internal/help: add documentation for language version downgrading

This change adds documentation for language version downgrading using
build constraints.

Fixes #68161
For #61894

Change-Id: I283a51afd7020c9fd1f5469a6a93fd814ba32f7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/595475
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

10 months agoslices: update docs for All, Backward, Values
Jes Cok [Thu, 27 Jun 2024 16:00:00 +0000 (00:00 +0800)]
slices: update docs for All, Backward, Values

For #61899

Change-Id: I3586b9b59e87159d21e1a270dabb3af213592739
Reviewed-on: https://go-review.googlesource.com/c/go/+/595515
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
10 months agocmd/link: don't skip code sign even if dsymutil didn't generate a file
Cherry Mui [Fri, 21 Jun 2024 16:20:38 +0000 (12:20 -0400)]
cmd/link: don't skip code sign even if dsymutil didn't generate a file

Even if dsymutil didn't generate a file (which should not happen
with the Apple toolchain with the correct setup), we should not
skip next steps, e.g. code sign. A return statement makes it exit
too early.

Updates #68088.

Change-Id: Ic1271ed1b7fe5bdee5a25cc5d669a105173b389e
Reviewed-on: https://go-review.googlesource.com/c/go/+/593660
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
10 months agocmd/link: don't let dsymutil delete our temp directory
Cherry Mui [Fri, 21 Jun 2024 15:56:45 +0000 (11:56 -0400)]
cmd/link: don't let dsymutil delete our temp directory

To work around #59026, where dsymutil may not clean up its temp
directory at exit, we set DSYMUTIL_REPRODUCER_PATH to our temp
directory so it uses that, and we can delete it at the end.

In Xcode 16 beta, dsymutil deletes the DSYMUTIL_REPRODUCER_PATH
directory even if it is not empty. We still need our tmpdir at the
point, so give a subdirectory to dsymutil instead.

For #68088.

Change-Id: I18759cc39512819bbd0511793ce917eae72245d6
Reviewed-on: https://go-review.googlesource.com/c/go/+/593659
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

10 months agoos: rewrite TestChtimesWithZeroTimes
Kir Kolyshkin [Sun, 9 Jun 2024 19:47:23 +0000 (12:47 -0700)]
os: rewrite TestChtimesWithZeroTimes

First, this enables checks on DragonFly BSD, which partially works since
CL 589496 (except two things: atime is not supported on hammer2 fs, and
when both times are omitted, it doesn't work due to a kernel bug).

Second, there are a few problems with TestChtimesWithZeroTimes:

 - test cases are interdependent (former cases influence the latter ones),
   making the test using too many different times and also hard to read;

 - time is changed forward not backward which could be racy;

 - if the test has failed, it hard to see which exact case is failing.

Plus, there are issues with the error exclusion code in
TestChtimesWithZeroTimes:

 - the atime comparison is done twice for the default ("unix") case;

 - the atime exclusion caused by noatime mount flag applies to all
   unixes rather than netbsd only as it should;

 - the atime exclusion tries to read wrong files (/bin/mounts and
   /etc/mtab instead of /proc/mounts);

 - the exclusion for netbsd is only applied for 64-bit arches, which
   seems wrong (and I've reproduced noatime issue on NetBSD 9.4/i386).

Let's rewrite it, fixing all these issues, and rename to
TestChtimesOmit.

NB: TestChtimes can now be removed.

Change-Id: If9020256ca920b4db836a1f0b2e055b5fce4a552
Reviewed-on: https://go-review.googlesource.com/c/go/+/591535
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joedian Reid <joedian@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

10 months agocrypto/tls: apply QUIC session event flag to QUICResumeSession events
Damien Neil [Mon, 24 Jun 2024 17:01:47 +0000 (10:01 -0700)]
crypto/tls: apply QUIC session event flag to QUICResumeSession events

Go 1.23 adds two new events to QUICConns: QUICStoreSessionEvent and
QUICResumeSessionEvent. We added a QUICConfig.EnableStoreSessionEvent
flag to control whether the store-session event is provided or not,
because receiving this event requires additional action from the caller:
the session must be explicitly stored with QUICConn.StoreSession.

We did not add a control for whether the resume-session event is
provided, because this event requires no action and the caller is
expected to ignore unknown events.

However, we never documented the expectation that callers ignore
unknown events, and quic-go produces an error when receiving an
unexpected event. So change the EnableStoreSessionEvent flag to
apply to both new events.

Fixes #68124
For #63691

Change-Id: I84af487e52b3815f7b648e09884608f8915cd645
Reviewed-on: https://go-review.googlesource.com/c/go/+/594475
Reviewed-by: Marten Seemann <martenseemann@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
10 months agocmd/internal/obj/arm64: fix return with register
Joel Sing [Fri, 14 Jun 2024 15:28:46 +0000 (01:28 +1000)]
cmd/internal/obj/arm64: fix return with register

ARM64 allows for a register to be specified with a return
instruction. While the assembler parsing and encoding currently
supports this, the preprocess function uses LR unconditionally.
Correct this such that if a register is specified, the register
is used.

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

10 months agocmd/compile: update README to reflect dead code elimination changes
func25 [Sun, 23 Jun 2024 05:53:47 +0000 (05:53 +0000)]
cmd/compile: update README to reflect dead code elimination changes

The description of middle-end dead code elimination is inconsistent with the current implementation.

The early dead code elimination pass of IR nodes is no longer located in cmd/compile/internal/deadcode and is no longer called by gc/main.go:Main. It has been moved to the unified IR writer phase. This update modifies the README to reflect this architectural change.

Change-Id: I78bd486edefd6b02948fee7de9ce6c83b147bc1d
GitHub-Last-Rev: 76493ce8b08cd585d761d65d29b984360f7ee628
GitHub-Pull-Request: golang/go#68134
Reviewed-on: https://go-review.googlesource.com/c/go/+/593638
Reviewed-by: Robert Griesemer <gri@google.com>
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>
Auto-Submit: Keith Randall <khr@golang.org>

10 months agocmd: run go mod tidy after CL 593684
Dmitri Shuralyov [Mon, 24 Jun 2024 20:39:21 +0000 (16:39 -0400)]
cmd: run go mod tidy after CL 593684

Reported by TestAllDependencies/cmd(thorough) in cmd/internal/moddeps.

Change-Id: I897baf00efbfebd07abe387f54c7ce4fc14444e6
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/594536
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

10 months agocmd/vendor: vendor x/telemetry@38a4430
Hana (Hyang-Ah) Kim [Mon, 24 Jun 2024 15:45:12 +0000 (11:45 -0400)]
cmd/vendor: vendor x/telemetry@38a4430

For #68109

Change-Id: I73a3d23dd6c15ff4954ebe7a52c6c308fea947ae
Reviewed-on: https://go-review.googlesource.com/c/go/+/593684
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Hyang-Ah Hana Kim <hyangah@gmail.com>

10 months agonet/http: document that Request.Clone does not deep copy Body
Damien Neil [Mon, 17 Jun 2024 21:54:22 +0000 (14:54 -0700)]
net/http: document that Request.Clone does not deep copy Body

Fixes #36095

Change-Id: I94ae014b0ee45b4aeb38cb247e42cfc13f663ded
Reviewed-on: https://go-review.googlesource.com/c/go/+/593175
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
10 months agocrypto/tls: replay test recordings without network
Filippo Valsorda [Sun, 23 Jun 2024 12:10:14 +0000 (14:10 +0200)]
crypto/tls: replay test recordings without network

There is no reason to go across a pipe when replaying a conn recording.
This avoids the complexity of using localPipe and goroutines, and makes
handshake benchmarks more accurate, as we don't measure network
overhead.

Also note how it removes the need for -fast: operating locally we know
when the flow is over and can error out immediately, without waiting for
a read from the feeder on the other side of the pipe to timeout.

Avoids some noise in #67979, but doesn't fix the two root causes:
localPipe flakes and testing.B races.

Updates #67979

Change-Id: I153d3fa5a24847f3947823e8c3a7bc639f89bc1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/594255
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Joedian Reid <joedian@google.com>
10 months agoos: TestChtimes: separate hasNoatime
Kir Kolyshkin [Fri, 21 Jun 2024 23:59:21 +0000 (16:59 -0700)]
os: TestChtimes: separate hasNoatime

Move the noatime check to a separate function (to be used by CL 91535),
adding some documentation along the way.

Unify the atime error message.

Change-Id: I5f75a4399f6e1b16ae20438003de5460f3eeb5aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/594075
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joedian Reid <joedian@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

10 months agocmd/internal/obj/arm64: Enable arm64 assembler tests for cross-compiler builds
Sebastian Nickolls [Thu, 25 Apr 2024 16:19:20 +0000 (17:19 +0100)]
cmd/internal/obj/arm64: Enable arm64 assembler tests for cross-compiler builds

Some of the tests for the arm64 assembler are not running for
cross-compiled arm64 builds with GOARCH=arm64. This patch allows the
tests to run for all architectures and moves the test that can only run on
arm64 into its own conditionally compiled file.

Updates #44734

Change-Id: I045870d47cdc1280bfacc1ef275f34504278ed89
Reviewed-on: https://go-review.googlesource.com/c/go/+/587315
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Sebastian Nickolls <sebastian.nickolls@arm.com>
10 months agonet/netip: add test that Compare and reflect.DeepEqual match
Brad Fitzpatrick [Mon, 24 Jun 2024 14:57:45 +0000 (07:57 -0700)]
net/netip: add test that Compare and reflect.DeepEqual match

Updates #68113

Change-Id: I1107686ef364f77f48f55534ea8ec68d1785e1e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/594375
Auto-Submit: Brad Fitzpatrick <bradfitz@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
10 months agonet/netip: unexport fields of addrDetail
Ian Lance Taylor [Sun, 23 Jun 2024 22:21:28 +0000 (15:21 -0700)]
net/netip: unexport fields of addrDetail

For #68113

Change-Id: I19c7d8eff8e3a7a1b6c8e28cb867edeca6be237d
Reviewed-on: https://go-review.googlesource.com/c/go/+/593737
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
10 months agocmd/link/internal/ld: handle "\r" in MinGW "--print-prog-name" output
Davis Goodin [Fri, 21 Jun 2024 23:44:44 +0000 (16:44 -0700)]
cmd/link/internal/ld: handle "\r" in MinGW "--print-prog-name" output

Fix the "gcc --print-prog-name" output parser to handle "\r\n", not only
"\n". The MinGW compiler on Windows uses "\r\n" as line endings, causing
the existing parser to create paths like
".../x86_64-w64-mingw32/bin/ar.exe\r", which is not correct. By trimming
the "\r\n" cutset, both types of line endings are handled correctly.

Fixes #68121

Change-Id: I04b8bf9b6a5b29a1e59a6aa07fa4faa4c5bdeee6
Reviewed-on: https://go-review.googlesource.com/c/go/+/593916
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>