1
0
mirror of https://github.com/golang/go synced 2024-11-11 19:21:37 -07:00
Commit Graph

57066 Commits

Author SHA1 Message Date
Alexander Yastrebov
3491615b1b all: fix spelling errors
Fix spelling errors discovered using https://github.com/codespell-project/codespell.
Errors in data files and vendored packages are ignored.
2023-06-14 00:59:06 +02:00
Michael Pratt
80629caecb all: update vendored dependencies
Generated with x/build/cmd/updatestd.

For #36905.
For #55079.

Change-Id: I5ba28993359cb5bbfb1bc7cfcea9576b07fcfb14
Reviewed-on: https://go-review.googlesource.com/c/go/+/502878
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-13 21:37:23 +00:00
Achille Roussel
54c75b40a2 net: ensure net.Addr values match the connection type on wasip1
net.FileListener returns values of type *net.TCPListener, which can be
asserted by the application. The (*net.TCPListener).Addr method
documents that the underlying type of its return value is *net.TCPAddr,
which is fixed by this change.

Change-Id: Ife9906716d1b512092024ba50797bf7831536b75
Reviewed-on: https://go-review.googlesource.com/c/go/+/502335
Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
2023-06-13 21:06:56 +00:00
Robert Griesemer
dac75b6675 go/types, types2: fix Hilbert test for stand-alone run
When run as a stand-alone test (without other tests running before),
the builtin function 'assert' (only available for testing) is missing.
Make sure it's declared.

This change only affects this test, when run stand-alone, as in:

go test -run Hilbert

Fixes #60774.

Change-Id: Ib07d97ba2670b839e8ad11ef50d0e6581bb3d79d
Reviewed-on: https://go-review.googlesource.com/c/go/+/502996
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2023-06-13 21:00:12 +00:00
Russ Cox
9efa625d84 cmd/dist: more robust cleanup
Identify generated files by name prefix (z*) and content
(^// Code generated by go tool dist)
instead of having a fixed list. This will be more robust
against doing make.bash and then rewinding git and
then doing make.bash again.

Change-Id: If9b4d02f5ad65345623866176d96e9894a957dc8
Reviewed-on: https://go-review.googlesource.com/c/go/+/501036
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
2023-06-13 20:44:00 +00:00
Paul E. Murphy
e712759914 doc/go1.21: document GOPPC64=power10 changes
For #44549

Change-Id: I1af1d4bbd01a4571a32815bfea16bc395524551a
Reviewed-on: https://go-review.googlesource.com/c/go/+/501358
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
2023-06-13 20:35:51 +00:00
cui fliter
8b53c2d2fc all: fix mismatched symbols
There are some symbol mismatches in the comments, this commit attempts to fix them

Change-Id: I5c9075e5218defe9233c075744d243b26ff68496
Reviewed-on: https://go-review.googlesource.com/c/go/+/492996
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: shuang cui <imcusg@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
2023-06-13 20:02:49 +00:00
Russ Cox
70cb990b15 database/sql: fix flake in TestContextCancelDuringRawBytesScan
If the cancellation takes effect between Next and Scan,
then Scan returns context.Canceled, but the test wasn't
allowing this case.

The old flake reproduced easily with:

	go test -c
	stress ./sql.test -test.count=100 -test.run=TestContextCancelDuringRawBytesScan

The new test modes exercise that path directly instead of needing stress.

The new check for context.Canceled fixes the new test mode "top".

Fixes #60445.

Change-Id: I3870039a0fbe0a43c3e261b43b175ef83f818765
Reviewed-on: https://go-review.googlesource.com/c/go/+/502876
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
2023-06-13 19:41:21 +00:00
Russ Cox
ccf75b36ff cmd/internal/obj: make aix/ppc64 builds reproducible
sort.Slice was being used to sort some newly added entries by name
to make the ctxt.Data slice reproducible, but some existing entries
have the same name, and the effect was to take the non-determinism
of the tail entries and scatter it into the earlier, deterministic section
when multiple entries had the same name.

The specific entries with the same name are type SDWARFVAR, which
all have an empty name but different relocations. If they are shuffled,
then the relocation symbols are visited in a different order, which
enters them into the string table in a different order, which results in
different object files, different object file hashes, and different build IDs
for the final executables.

Use sort.SliceStable to avoid reordering entries we don't mean to reorder.

Also add a simple test for scheduling-related non-determinism.
I debugged this originally using 'go install -race cmd/compile',
but that was slow and turned out not to be terribly reliable.
Using a few different GOMAXPROCS settings turns out to be a much more
effective (and faster) way to scramble scheduling decisions.

Fixes #60759.

Change-Id: Ia966b02b9fdaefa971f998a09319ca375bdf8604
Reviewed-on: https://go-review.googlesource.com/c/go/+/502755
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
TryBot-Bypass: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-06-13 18:59:19 +00:00
Josh Rickmar
8b5ed3cdae runtime: Use doas -n in TestSUID on OpenBSD
This prevents a hang at a su password prompt when running this test on
OpenBSD.

Fixes #60690.

Change-Id: I62d27aa63f225f8247c324b87b5e688319061f4f
GitHub-Last-Rev: 217813a4d5
GitHub-Pull-Request: golang/go#60742
Reviewed-on: https://go-review.googlesource.com/c/go/+/502575
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2023-06-13 18:10:14 +00:00
Eli Bendersky
8faa79e91f sort: comments directing new code to use the slices package when applicable
Change-Id: I0d4e902736fb3a75d128a088901055bece6c1a71
Reviewed-on: https://go-review.googlesource.com/c/go/+/502555
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Eli Bendersky <eliben@google.com>
Auto-Submit: Eli Bendersky <eliben@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
2023-06-13 18:07:00 +00:00
Robert Griesemer
17dcbd8662 spec: de-emphasize string(int) conversions
Fixes #60731.

Change-Id: I71fad1c8385b13d036bb0ce7ae6bd21e0f596e51
Reviewed-on: https://go-review.googlesource.com/c/go/+/502657
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
2023-06-13 17:41:11 +00:00
Robert Griesemer
ee5af6103d spec: document new program initialization process
For #57411.

Change-Id: I94982d939d16ad17174f801cc167cc10ddc8da30
Reviewed-on: https://go-review.googlesource.com/c/go/+/501696
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2023-06-13 17:40:15 +00:00
Filippo Valsorda
886fba5871 crypto/ecdsa: properly truncate P-521 hashes
Before, if a hash was exactly 66 bytes long, we weren't truncating it
for use with P-521, because the byte length was not overflowing.
However, the bit length could still overflow.

Fixes #60741

Change-Id: I37a0ee210add0eb566e6dc1c141e83e992983eb6
Reviewed-on: https://go-review.googlesource.com/c/go/+/502478
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
2023-06-13 16:14:23 +00:00
Philip Silva
bce7aec3cd runtime/trace: disable frame pointer unwinding on plan9
Fixes #60254

Change-Id: Ifd9e517a9479e5cd63fd3622b2556989d5f84eb9
Reviewed-on: https://go-review.googlesource.com/c/go/+/499036
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Bypass: Keith Randall <khr@golang.org>
2023-06-13 14:08:14 +00:00
Eli Bendersky
d9b87d7cc3 slices: add benchmark for IsSorted vs. IntsAreSorted
We'd like to mention in a comment that users should prefer
slices.IsSorted over sort.IntsAreSorted and similar
functions. Create a benchmark that shows this.

goos: linux
goarch: amd64
pkg: slices
cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
BenchmarkIntsAreSorted-8             	    6031	    198315 ns/op
BenchmarkIsSorted-8                  	   26580	     45801 ns/op

Change-Id: I4f14fafd799ecec35c8a5215b74994e972103061
Reviewed-on: https://go-review.googlesource.com/c/go/+/502556
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Eli Bendersky‎ <eliben@golang.org>
Reviewed-by: Eli Bendersky <eliben@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-13 12:26:08 +00:00
Russ Cox
b0e1707f94 cmd/link: fix log formats for log.Fatal calls
link contains many calls to log.Fatal, but it uses the default log output
format, which is configured for server programs, not command-line tools.
Set it up for command-line tools instead.

Changes errors like

2023/06/12 14:32:24 reference to undefined builtin "runtime.gcWriteBarrier" from package "internal/abi"

to

link: reference to undefined builtin "runtime.gcWriteBarrier" from package "internal/abi"
Change-Id: I3565960408c03f2f499a7517ec18c01870eb166c
Reviewed-on: https://go-review.googlesource.com/c/go/+/502698
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-06-13 03:06:54 +00:00
Achille Roussel
0b5a4afec9 net: test net.FileConn and net.FileListener with UDP sockets on wasip1
The WASI specification has file types for both stream and datagram
sockets. This change refactors the internal implementation of the
net.FileConn and net.FileListener functions to avoid returning a
misleading ENOTSOCK when calling net.FileConn with a file referencing
a datagram socket and instead properly construct net.UDPConn values
or return EOPNOTSUPP otherwise.

Change-Id: I594f700847254895cd6ce172979fd89c4b851940
Reviewed-on: https://go-review.googlesource.com/c/go/+/502316
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2023-06-12 23:11:39 +00:00
Michael Pratt
d22b08bd64 doc/go1.21: clean up remaining TODOs
These sections are now complete, remove remaining TODOs. Several entries
were missing CL numbers.

For #58645

Change-Id: I67489356016013be876c4bd522afb977becf54ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/502696
Run-TryBot: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
2023-06-12 21:00:52 +00:00
Russ Cox
f7e11723e5 cmd/dist: do not use user build cache in versioned trees
There is no guarantee that the user build cache will have
correct data if we are using a versioned build (with a VERSION file),
because that overrides the use of tool build IDs for staleness.
An earlier build might have run with a buggy compiler, and we don't
want those files lying around.

Change-Id: I831956911162ccbd0b4d943c305b3537918fe119
Reviewed-on: https://go-review.googlesource.com/c/go/+/502699
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
2023-06-12 20:59:04 +00:00
Keith Randall
c643b29381 cmd/compile: use callsite as line number for argument marshaling
Don't use the line number of the argument itself, as that may be from
arbitrarily earlier in the function.

Fixes #60673

Change-Id: Ifc0a2aaae221a256be3a4b0b2e04849bae4b79d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/502656
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@google.com>
2023-06-12 20:34:37 +00:00
Bryan C. Mills
992afd9d54 cmd/go/internal/modload: address comment and test issues from CL 496635
Michael noticed some minor issues in backports of CL 496635.
Those issues have been addressed in the backport CLs; this change
applies them to the main branch as well.

Updates #60313.

Change-Id: If68696711a10a9270193df66ed551395c14cae00
Reviewed-on: https://go-review.googlesource.com/c/go/+/502695
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-12 19:42:01 +00:00
Michael Matloob
962753b015 go/build: check for invalid import paths again
The go parser previously checked for invalid import paths, go/build,
seeing the parse error would put files with invalid import paths into
InvalidGoFiles. golang.org/cl/424855 removed that check from the
parser, which meant files with invalid import paths not have any parse
errors on them and not be put into InvalidGoFiles. Do a check for
invalid import paths in go/build soon after parsing so we can make
sure files with invalid import paths go into InvalidGoFiles.

This fixes an issue where the Go command assumed that if a file wasn't
invalid it had non empty import paths, leading to a panic.

Fixes #60230
Fixes #60686

Change-Id: I33c1dc9304649536834939cef7c689940236ee20
Reviewed-on: https://go-review.googlesource.com/c/go/+/502615
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
2023-06-12 19:15:55 +00:00
Filippo Valsorda
a674c6376f Revert "crypto/internal/nistec: refactor scalar multiplication"
This reverts CL 471256, except for its new tests, which are expanded to
cover the case in #60717.

Updates #60717

Change-Id: I712bbcd05bf3ea4a2c9aecc9e0f02841b21aadfa
Reviewed-on: https://go-review.googlesource.com/c/go/+/502477
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2023-06-12 18:48:23 +00:00
Robert Griesemer
3367475e83 go/types, types2: use correct reverse inference approach
To infer type arguments in an assignment of the form

        var target func(t1, t2, ...) = g

where g is a generic function

        func g[P1, P2, ...](p1, p2, ...)

the type checker used the synthetic function call

        g(t1, t2, ...)

But because each argument (of type) t1, t2, ... is assigned to its
corresponding parameter p1, p2, ..., type inference uses assignment
rules ("inexact match") for unification.

As a result, types such as mystring and string match even though
they should not (they are not identical), yet function parameter
types must be identical to match.

This CL fixes this by constructing the synthetic call

        g'(func(t1, t2, ...))

where g' is the generic function

        func g'[P1, P2, ...](func(p1, p2, ...))

This mimics the function assignment directly by representing it as
a single argument passing (of a function-typed argument). Function
parameter types must now be identical to unify.

As an added benefit, the implementation is simpler.

As a consequence, when such an assignment is invalid because the
function types cannot possibly match, we now correctly get an
inference error. Without this change, in some cases unification
would succeed, only to lead to an assignment error afterwards.

While at it, update the date in the copyright notice of
testdata/manual.go so we don't need to fix it each time we copy
code from a test case in manual.go into a issueXXXXX.go file.

Fixes #60688.

Change-Id: I716247f426ef33d76c7849b0c33c59124e55b859
Reviewed-on: https://go-review.googlesource.com/c/go/+/501938
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-12 17:29:51 +00:00
Robert Griesemer
eaa4b1a6e4 cmd/compile/internal/types2: add missing tests from go/types
Add 3 tests that exist in go/types but that were not ported to types2.

Change-Id: I34d219f605f9ae66e8b4439c3dfe93cfa0ec9524
Reviewed-on: https://go-review.googlesource.com/c/go/+/501304
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-12 16:28:21 +00:00
Robert Griesemer
f35d2dae74 go/types, types2: use inexact unification when unifying against core types
Follow-up on CL 498955 which introduced a unification mode, to be used
to control the precision of unification of element types (CL 498895):
When unifying against core types of unbound type parameters, we must
use inexact unification at the top (irrespective of the unification mode),
otherwise it may fail when unifying against a defined type (core types
are always underlying types).

No specific test case (I have not been able to create one yet).

Change-Id: Ie15e98f4b9e9fb60d6857d34b03d350ebbf0375e
Reviewed-on: https://go-review.googlesource.com/c/go/+/501302
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
2023-06-12 16:27:51 +00:00
chressie
0fcc70ecd5 doc/go1.21: fix typo
Change-Id: Ie0af0ff135ac14d35476d738a16f04e9c3eebcd2
Reviewed-on: https://go-review.googlesource.com/c/go/+/502475
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Chressie Himpel <chressie@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-06-12 15:53:08 +00:00
Bryan C. Mills
1db23771af cmd/go: omit checksums for go.mod files needed for go version lines more often in pre-1.21 modules
This updates the logic from CL 489075 to avoid trying to save extra
sums if they aren't already expected to be present
and cfg.BuildMod != "mod" (as in the case of "go list -m -u all" with
a go.mod file that specifies go < 1.21).

Fixes #60667.
Updates #56222.

Change-Id: Ied6ed3e80a62f9cd9a328b43a415a42d14481056
Reviewed-on: https://go-review.googlesource.com/c/go/+/502015
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-12 13:58:58 +00:00
Ian Lance Taylor
ee46f0b508 net/url: correct field name in Redacted doc comment
Fixes #60716

Change-Id: I86037784d6c12fd22bd03c3efabef379fa0646aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/502355
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-06-11 23:27:39 +00:00
Dmitri Shuralyov
bd8c133097 doc/go1.21: add heading for cmp package
For #59488.
For #58645.

Change-Id: Ia9b76d49825dd74f7e52d829ec6d47e6c2addd76
Reviewed-on: https://go-review.googlesource.com/c/go/+/501825
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@google.com>
2023-06-11 23:27:37 +00:00
Ian Lance Taylor
1fd3cc7cd0 cmp, builtin: document NaN behavior
Add notes for cmp.Ordered and builtin.{min,max}.

Fixes #60648

Change-Id: I81806af2d9a0613befde3f2bbfbc2720f0726912
Reviewed-on: https://go-review.googlesource.com/c/go/+/502235
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2023-06-11 00:41:42 +00:00
Ian Lance Taylor
fd353a1280 context: fix doc tipo (s/timout/timeout)
Change-Id: Ib02b35887896eab418ba9dde764754538cb23b4f
Reviewed-on: https://go-review.googlesource.com/c/go/+/501277
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-11 00:33:08 +00:00
Jes Cok
e14937866e runtime: fix typos
Change-Id: If13f4d4bc545f78e3eb8c23cf2e63f0eb273d71f
GitHub-Last-Rev: 32ca70f52a
GitHub-Pull-Request: golang/go#60703
Reviewed-on: https://go-review.googlesource.com/c/go/+/502055
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-10 16:03:33 +00:00
chenguoqi
fafa4091ab syscall: implement Ptrace{Set,Get}Regs using PTRACE_{GET,SET}REGSET on all linux platforms
In the ptrace system call, most of the newer architectures (e.g. arm64,riscv64,loong64)
do not provide support for the command PTRACE_{GET, SET}REGS.

The Linux kernel 2.6.33-rc7[1] introduces support for the command PTRACE_{GET,SET}REGSET,
which exports different types of register sets depending on the NT_* types, completely
overriding the functionality provided by PTRACE_{GET,SET}REGS.

[1] https://lore.kernel.org/all/20100211195614.886724710@sbs-t61.sc.intel.com/

Fixes #60679.

Change-Id: I8c2671d64a7ecd654834740f4f1e1e50c00edcae
Reviewed-on: https://go-review.googlesource.com/c/go/+/501756
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-06-10 16:02:54 +00:00
Michael Matloob
82dc37c0d0 cmd/go: don't assume ImportStack always set on PackageError
When determining DepsErrors for packages, we were trying to sort
errors by the top package on their ImportStack (which would likely be
the package the error was generated for) to get a deterministic
error order.

The problem is that some PackageErrors don't have ImportStacks set on
them. Fall back to sorting the errors by the error text (instead of
making things more complicated by tracking the packages that produced
the errors more closely).

Fixes #59905

Change-Id: Id305e1e70801f8909fd6463383b8eda193559787
Reviewed-on: https://go-review.googlesource.com/c/go/+/501978
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2023-06-09 22:48:58 +00:00
Cherry Mui
5e9b76fe2a cmd/link: mangle certain instantiated function name in plugin mode
In plugin mode, we mangle the type symbol name so it doesn't
contain characters that may confuse the external linker. With
generics, instantiated function name includes type names, so it
may also contain such characters and so also needs to be mangled.

Fixes #58800.

Change-Id: Ibb08c95b89b8a815ccef98193d3a025e9d4756cc
Reviewed-on: https://go-review.googlesource.com/c/go/+/500095
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
2023-06-09 16:00:05 +00:00
Filippo Valsorda
6801c27837 crypto/tls: make SessionState.Extra a slice of byte slices
Fixes #60539
Updates #60105

Change-Id: I7b567cc1d0901891ed97d29591db935cd487cc71
Reviewed-on: https://go-review.googlesource.com/c/go/+/501675
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
2023-06-09 15:26:32 +00:00
qmuntal
1f11ea6c41 cmd/go: fix TestScript/gotoolchain* when go.env doesn't set GOTOOLCHAIN=auto
Some of the TestScript/gotoolchain* tests assume that go.env contains
GOTOOLCHAIN=auto, but that's not always the case, for example CI
environments may set it to `local` to avoid downloading a new toolchain.

This commit fixes the tests to work regardless of the value of
GOTOOLCHAIN in go.env.

Fixes #60685

Change-Id: Ieda22574f8a028893762274cf9db721c9d69bf7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/502035
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
2023-06-09 12:40:01 +00:00
cui fliter
39effbc105 all: fix function names in comments
Change-Id: I915eff34fcfe82f3514254f7d8998baa88a91da6
Reviewed-on: https://go-review.googlesource.com/c/go/+/501997
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: shuang cui <imcusg@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-06-09 04:07:29 +00:00
Ian Lance Taylor
19b814b80b net: update SOCK_CLOEXEC comment
For #45964
For #59359

Change-Id: I7fd295a096e5776102e057789d157da681df9073
Reviewed-on: https://go-review.googlesource.com/c/go/+/501939
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-06-09 04:04:07 +00:00
Ian Lance Taylor
bd00528d04 Revert "net: remove fallback path in sysSocket"
This reverts CL 40364.

Reason for revert: Fallback path is still required on Solaris.

For #45964
For #59359

Change-Id: I4b8c8af77ee987cad6617221793b90c9a8829c3e
Reviewed-on: https://go-review.googlesource.com/c/go/+/501276
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-06-09 00:17:39 +00:00
Ian Lance Taylor
ce8eadf591 doc/go1.21: remove CL 472195 TODO
It's not needed per CL 499515.

Change-Id: I2a5ce46be93dad1442c0aad736fd8d230ee35f39
Reviewed-on: https://go-review.googlesource.com/c/go/+/501996
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
2023-06-09 00:01:48 +00:00
Michael Anthony Knyszek
7b325ba27d runtime: apply looser bound to /gc/heap/live:bytes in test
/gc/heap/live:bytes may exceed MemStats.HeapAlloc, even when all data is
flushed, becuase the GC may double-count objects when marking them. This
is an intentional design choice that is largely inconsequential. The
runtime is already robust to it, and the condition is rare.

Fixes #60607.

Change-Id: I4da402efc24327328d2d8780e4e49961b189f0ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/501858
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-08 19:25:35 +00:00
Damien Neil
0cc58564f6 go1.21: document crypto/tls additions
For #60105
For #44886

Change-Id: I8f6cfc4490535979ee8c0d8381c03b03c9c7b9a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/501303
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
2023-06-08 18:50:10 +00:00
Filippo Valsorda
bff4b0edcb doc/go1.21: more crypto release notes
Change-Id: I06981e13b89b3bde8f0d2fc9993240a372fb0457
Reviewed-on: https://go-review.googlesource.com/c/go/+/501815
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2023-06-08 17:09:04 +00:00
qmuntal
765bd691e2 doc/go1.21: NOFRAME heuristic changes
For #58378

Change-Id: I960b97f33a8bf29d3a9622b58d278544d0970a38
Reviewed-on: https://go-review.googlesource.com/c/go/+/501516
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
2023-06-08 17:06:57 +00:00
Ian Lance Taylor
a272d1f687 doc/go1.21: mention NewFile on non-blocking descriptor
The returned descriptor now remains in non-blocking mode.

For #58408
For #60211

Change-Id: I88d33c180db642d055b4fed3b03a9afa02e746bd
Reviewed-on: https://go-review.googlesource.com/c/go/+/501699
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
2023-06-08 16:48:20 +00:00
Ian Lance Taylor
471561c590 doc/go1.21: mention html/template.ErrJSTemplate
For #59584

Change-Id: Iaa3f8b23010ad452c134ac608c63d2a41cc4e409
Reviewed-on: https://go-review.googlesource.com/c/go/+/501698
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2023-06-08 16:48:19 +00:00
Ian Lance Taylor
cc99093dfa doc/go1.21: mention new cmp package
For #59488

Change-Id: I73ee4d1d8b9d8e6f0aad9e3bb98729aaa0f06a47
Reviewed-on: https://go-review.googlesource.com/c/go/+/501697
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-06-08 16:47:24 +00:00