]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
2 years agolib/time, time/tzdata: update to 2021e
Ian Lance Taylor [Wed, 10 Nov 2021 00:17:50 +0000 (16:17 -0800)]
lib/time, time/tzdata: update to 2021e

Doing this a little early in the release cycle as there have been some
changes in the handling of old timezones. They should continue to
work as expected, but more testing time may be useful.

For #22487

Change-Id: I3686fed79a052c46112445055044cff5842f2a45
Reviewed-on: https://go-review.googlesource.com/c/go/+/362874
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2 years agomisc/cgo/testshared: correct test of gccgo version number
Ian Lance Taylor [Wed, 10 Nov 2021 17:35:59 +0000 (09:35 -0800)]
misc/cgo/testshared: correct test of gccgo version number

We still don't run the gccgo tests, because they don't run in module mode.
But now we at least get the version number check right.

Change-Id: Ifde4512c30605d1cb7e3a521f381a05c783549b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/362996
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agosync: clarify the validity to call Map methods inside Range
Changkun Ou [Mon, 26 Jul 2021 08:56:30 +0000 (10:56 +0200)]
sync: clarify the validity to call Map methods inside Range

This change clarifies that calling all Map methods inside the callback
of Range is allowed. For further assurance, a nested range call test
is also added.

Fixes #46399

Change-Id: I0a766a5c1470e6b573ec35df1ccd62b2e46f1561
Reviewed-on: https://go-review.googlesource.com/c/go/+/337389
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>

2 years agotest: add test that was miscompiled by gccgo
Ian Lance Taylor [Thu, 11 Nov 2021 00:06:18 +0000 (16:06 -0800)]
test: add test that was miscompiled by gccgo

For #49512

Change-Id: Ic08652a4ec611b27150bf10b1118c1395715e5d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/363156
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2 years agonet: do more faithful conversion from AddrPort to UDPAddr
Jason A. Donenfeld [Fri, 5 Nov 2021 12:02:09 +0000 (13:02 +0100)]
net: do more faithful conversion from AddrPort to UDPAddr

A UDPAddr with a nil IP is a valid state, representing an AF-agnostic
unspecified address, so checking for addr.IsValid() isn't correct;
remove that, as it's only needed in the UDP rx path where it can be
added. Secondly, forcing everything to be IPv6 also is not correct, and
was likely done when the missing .AsSlice() made doing the right thing
less ergonomic. Fix this by using .AsSlice(), which properly preserves
IP version.

Change-Id: Idd1eaecd4076f32a843f859a0a9802ef98f956d3
Reviewed-on: https://go-review.googlesource.com/c/go/+/361478
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2 years agocmd/compile/internal/types2: remove structuralString in favor of inlined code
Robert Griesemer [Wed, 10 Nov 2021 21:36:23 +0000 (13:36 -0800)]
cmd/compile/internal/types2: remove structuralString in favor of inlined code

structuralString was used only in one place (for built-in copy).
Remove it in favor of custom and more efficient inlined code.

Follow-up on feedback received for CL 363075.

Change-Id: Ic5857c47255c5c712be7971aae4542fef9960fe6
Reviewed-on: https://go-review.googlesource.com/c/go/+/363154
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agocmd/compile/internal/types2: slightly relax notion of structural type
Robert Griesemer [Wed, 10 Nov 2021 20:11:03 +0000 (12:11 -0800)]
cmd/compile/internal/types2: slightly relax notion of structural type

If we have all channel types in a constraint, there is no structural type
if they don't all have the same channel direction (and identical element
types, of course). By allowing different channel types for the purposes of
the structural type, as long as there is not a send-only _and_ a receive-
only channel in the type set, we make it possible to find a useful, if
restricted by channel direction, structural type where before there was
none.

So if we have unrestricted and send-only channels, the structural type is
the send-only channel, and vice versa.

For all operations on channels that rely on a structural type, it's always
ok to have an unrestricted channel, so this is not affecting their behavior.
But it makes those operations more flexible in the presence of type parameters
containing mixed channel types.

For constraint type inference, where we currently may not infer a channel
at all, this change allows us to infer a more restricted channel (send- or
receive-only). If the inferred channel type is a valid type argument we win;
if not we haven't lost anything.

Use structuralType for send and receive operations and adjust related
error messages (the error message that change are the ones involving
type parameters, so historic error messages are preserved).

Fixes #45920.

Change-Id: If3a64d29c37e7734d3163df330f8b02dd032bc60
Reviewed-on: https://go-review.googlesource.com/c/go/+/363075
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2 years agocmd/compile: don't do Resolve on OKEY identifiers during import
Dan Scales [Wed, 10 Nov 2021 19:39:18 +0000 (11:39 -0800)]
cmd/compile: don't do Resolve on OKEY identifiers during import

For generic functions, we can export untransformed OKEY nodes, and the
key identifier is written as an ONONAME. But in this case, we do not
want to call Resolve() on the identifier, since we may resolve to a
global type (as happens in this issue) or other global symbol with the
same name, if it exists. We just want to keep the key identifier as an
Ident node.

To solve this, I added an extra bool when exporting an ONONAME entry,
which indicates if this entry is for a key or for a global (external)
symbol. When the bool is true (this is for a key), we avoid calling
Resolve().

Fixes #49497

Change-Id: Ic8fa93d37bcad2110e0e0d060080b733e07e35d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/363074
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2 years agocmd/go: add 'go mod vendor -o' flag
Paschalis Tsilias [Wed, 28 Jul 2021 14:03:21 +0000 (17:03 +0300)]
cmd/go: add 'go mod vendor -o' flag

Adds a new flag to 'go mod vendor' which overrides the default
'vendor' destination directory. This can be helpful for writing the
vendor tree to a temporary location for use by other tools.
The argument can be a relative or an absolute path.
This flag has no other influence on how the command behaves.

Fixes #47327

Change-Id: I4502931127616b181dc90a2066d2fb57bfe48f96
Reviewed-on: https://go-review.googlesource.com/c/go/+/338149
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Trust: Bryan C. Mills <bcmills@google.com>
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agoruntime: rewrite TestPhysicalMemoryUtilization
Michael Anthony Knyszek [Wed, 10 Nov 2021 20:14:15 +0000 (20:14 +0000)]
runtime: rewrite TestPhysicalMemoryUtilization

This test changes TestPhysicalMemoryUtilization to be simpler, more
robust, and more honest about what's going on.

Fixes #49411.

Change-Id: I913ef055c6e166c104c62595c1597d44db62018c
Reviewed-on: https://go-review.googlesource.com/c/go/+/362978
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: David Chase <drchase@google.com>
2 years agointernal/cache: document 'go clean -fuzzcache' in README
emahiro [Thu, 21 Oct 2021 09:01:10 +0000 (18:01 +0900)]
internal/cache: document 'go clean -fuzzcache' in README

Fixes: #48900
Change-Id: I9235441886ed7cbdfdcbd283480f52d9216c3ea2
Reviewed-on: https://go-review.googlesource.com/c/go/+/357233
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Katie Hockman <katie@golang.org>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Katie Hockman <katie@golang.org>

2 years agocmd/compile/internal/types2: refer to structural rather than single underlying type...
Robert Griesemer [Wed, 10 Nov 2021 17:33:53 +0000 (09:33 -0800)]
cmd/compile/internal/types2: refer to structural rather than single underlying type in errors

This brings the error messages in sync with the terminology that
will be used it the spec.

Change-Id: Ia05993776c649be9eb2cdf948a583b9a49f9b192
Reviewed-on: https://go-review.googlesource.com/c/go/+/362997
Reviewed-by: Robert Findley <rfindley@google.com>
Trust: Robert Griesemer <gri@golang.org>

2 years agocmd/compile/internal/types2: move some functions into different files (cleanup)
Robert Griesemer [Wed, 10 Nov 2021 16:33:26 +0000 (08:33 -0800)]
cmd/compile/internal/types2: move some functions into different files (cleanup)

- move structuralType/structuralString into type.go
- move functions exported for the compiler into compilersupport.go
- updated/added comments
- removed AsNamed and AsInterface - not needed by compiler

No semantic changes.

Change-Id: Ia454a49edafd627c2a25b0b71db4aa93ddd7f1f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/362995
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2 years agogo/doc: don't treat functions returning type parameters as constructors
Robert Findley [Wed, 10 Nov 2021 16:21:57 +0000 (11:21 -0500)]
go/doc: don't treat functions returning type parameters as constructors

Functions returning type parameters were erroneously being interpreted
as 'constructors' of their type parameter, resulting in them being
excluded from documentation. Fix this by explicitly excluding type
parameters when looking for defined type names among function results.

Fixes #49477

Change-Id: I22510f655f47e192a852332df5b91740f46c51eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/362758
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agocmd/compile/internal/types2: rename structure to structuralType
Robert Griesemer [Wed, 10 Nov 2021 16:12:21 +0000 (08:12 -0800)]
cmd/compile/internal/types2: rename structure to structuralType

And rename structureString to structuralString.

Now that we have an updated definition for structural types in
the (forthcoming) spec, name the corresponding function accordingly.

No semantic changes.

Change-Id: Iab838f01a37075bedf2d8bc4f166b0217672b85f
Reviewed-on: https://go-review.googlesource.com/c/go/+/362994
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agocmd/compile/internal/types2: use type variables consistently in Checker.conversion
Robert Griesemer [Wed, 10 Nov 2021 05:12:03 +0000 (21:12 -0800)]
cmd/compile/internal/types2: use type variables consistently in Checker.conversion

We have V and T and Vu and Tu. When calling the various isX predicates
consistently use Vu and Tu.

(We could also use V an T because the predicates call under anyway,
but using Vu and Tu removes an unnecessary call to Named.under if
V or T are *Named.)

Also, removed some outdated comments.

Change-Id: I6fcd9ce5f6292e89ac2afd597b72fd0790e84ff1
Reviewed-on: https://go-review.googlesource.com/c/go/+/362895
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2 years agodoc: make a copy of the latest Go 1.17 spec
Robert Griesemer [Wed, 10 Nov 2021 04:22:26 +0000 (20:22 -0800)]
doc: make a copy of the latest Go 1.17 spec

This will allow us to compare the changes made for Go 1.18.

Change-Id: I1456270b201967f5cb05e66cec556939e6e33265
Reviewed-on: https://go-review.googlesource.com/c/go/+/362894
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2 years agoruntime: fix unworkable comments for go:nosplit
Hajime Hoshi [Fri, 5 Nov 2021 14:50:55 +0000 (23:50 +0900)]
runtime: fix unworkable comments for go:nosplit

Change-Id: I71c29a2dc7e5b2b6bc35093535228d2907b16b47
Reviewed-on: https://go-review.googlesource.com/c/go/+/361595
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Hajime Hoshi <hajimehoshi@gmail.com>

2 years agogo/parser: allow parsing aliases with type parameters
Robert Findley [Sun, 31 Oct 2021 15:33:00 +0000 (11:33 -0400)]
go/parser: allow parsing aliases with type parameters

We already guard against this in the type checker, and it will
eventually be allowed per the accepted proposal.

Add a placeholder error code for the corresponding type checker error.

Change-Id: I5cc2f1413ecc89ec2094f7178fdb156fb8cc2e43
Reviewed-on: https://go-review.googlesource.com/c/go/+/360235
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2 years agogo/types: disallow type cycles through type parameter lists
Robert Findley [Tue, 9 Nov 2021 23:48:16 +0000 (18:48 -0500)]
go/types: disallow type cycles through type parameter lists

This is a port of CL 361922 to go/types.

Change-Id: I790c8121a640c25fb655c926fb434d667dd59f76
Reviewed-on: https://go-review.googlesource.com/c/go/+/362756
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2 years agocmd/compile/internal/types2: disallow type cycles through type parameter lists
Robert Griesemer [Tue, 9 Nov 2021 00:09:11 +0000 (16:09 -0800)]
cmd/compile/internal/types2: disallow type cycles through type parameter lists

If we reach a generic type that is part of a cycle
and we are in a type parameter list, we have a cycle
through a type parameter list, which is invalid.

Fixes #49439.

Change-Id: Ia6cf97e1748ca0c0e61c02841202050091365b0b
Reviewed-on: https://go-review.googlesource.com/c/go/+/361922
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2 years agocmd/compile/internal/types2: rename Checker.cycle to Checker.validCycle
Robert Griesemer [Tue, 9 Nov 2021 04:17:22 +0000 (20:17 -0800)]
cmd/compile/internal/types2: rename Checker.cycle to Checker.validCycle

Also, invert the boolean result. This matches Checker.validType;
it's also easier to understand. Preparation for the next CL which
detects cycles through type parameter lists.

Change-Id: I00a75d2359ca20827c9bf406945508716c826fc4
Reviewed-on: https://go-review.googlesource.com/c/go/+/362336
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2 years agogo/types: rename Checker.cycle to Checker.validCycle
Robert Findley [Tue, 9 Nov 2021 23:40:38 +0000 (18:40 -0500)]
go/types: rename Checker.cycle to Checker.validCycle

This is a clean port of CL 362336 to go/types.

Change-Id: Iafeae7024fbb2872b07748affcea9676324ea59e
Reviewed-on: https://go-review.googlesource.com/c/go/+/362755
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2 years agogo/types: remove most asX converters (cleanup)
Robert Findley [Tue, 9 Nov 2021 21:41:01 +0000 (16:41 -0500)]
go/types: remove most asX converters (cleanup)

This is a port of CL 362118 to go/types, which is itself a roll-forward
of CL 362254, containing a bugfix.

Change-Id: I20067c7adf56bf64fe9ad080d998a7aefbdc1053
Reviewed-on: https://go-review.googlesource.com/c/go/+/362617
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2 years agomime: keep parsing after trailing semicolon
Illirgway [Mon, 5 Jul 2021 11:22:03 +0000 (11:22 +0000)]
mime: keep parsing after trailing semicolon

Fixes #46323

Change-Id: Ibd624b1aaa15f907b7eb965b4eaec61018a45486
GitHub-Last-Rev: 7ad670b088144a2a09860dd990c53dea75c0d40f
GitHub-Pull-Request: golang/go#47029
Reviewed-on: https://go-review.googlesource.com/c/go/+/332509
Trust: Ian Lance Taylor <iant@golang.org>
Trust: Damien Neil <dneil@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
2 years agocmd/go: add go work sync command
Michael Matloob [Mon, 25 Oct 2021 20:19:11 +0000 (16:19 -0400)]
cmd/go: add go work sync command

Change-Id: I09b22f05035700e1ed90bd066ee8f77c3913286a
Reviewed-on: https://go-review.googlesource.com/c/go/+/358540
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2 years agogo/types: report error for incomplete struct composite literal type
Robert Findley [Tue, 9 Nov 2021 19:20:11 +0000 (14:20 -0500)]
go/types: report error for incomplete struct composite literal type

This is a port of CL 361412 to go/types.

Change-Id: Ie5bccc7faba7ca9230e712f867b27ca9dcddba79
Reviewed-on: https://go-review.googlesource.com/c/go/+/362739
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2 years agogo/types: don't return an array type with invalid length
Robert Findley [Tue, 9 Nov 2021 19:56:39 +0000 (14:56 -0500)]
go/types: don't return an array type with invalid length

In preparation for porting CL 361412, fix a discrepancy in go/types,
where [-1]T is returned for an array type with invalid length.

Change-Id: Ia32f5b66c9c561ccf0c32af1922fc4690c66dbc3
Reviewed-on: https://go-review.googlesource.com/c/go/+/362738
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2 years agocmd/go: add workspace pruning mode
Michael Matloob [Tue, 19 Oct 2021 18:05:29 +0000 (14:05 -0400)]
cmd/go: add workspace pruning mode

[ this is a roll-forward of golang.org/cl/357169 with minor changes
to fix the cmd/go/internal/modload tests: because they don't run the
go command, some initialization isn't run on the test and modroots is
empty in cases it can't be when the full command setup is done. So
directly check for workFilePath != "" instead of calling inWorkspaceMode
which checks that Init is called first, and check that modRoots is non
empty when calling mustGetSingleMainModule.]

This change corrects a bug in the handling of module loading of
workspaces. Namely, there is an assumption by the module pruning code
that if a root module is selected then the packages of that module can
be resolved without loading the whole module graph. This is not true
in workspace mode because two workspace modules can require different
versions of a dependency. Worse, one workspace module can directly
require a depencency that is transitively required by another
workspace module, changing the version of that module loaded in the
fully expanded graph.

To correct this, a new 'workspace' pruning mode is added where the
roots are the workspace modules themselves, satisfying the assumption
made by the module pruning logic.

The rest of this change accounts for the new pruning mode where it's
used and correctly sets the requirements in this pruning mode.

Change-Id: I8bdf4b30f669c1ded0ed8a5dd202ac8d1939bbbd
Reviewed-on: https://go-review.googlesource.com/c/go/+/362754
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agocmd/go/internal/bug: remove duplicate code
Manlio Perillo [Sat, 24 Apr 2021 14:19:07 +0000 (16:19 +0200)]
cmd/go/internal/bug: remove duplicate code

Change-Id: I8a14b2fbb44f7ed1ea126cf27adc447f33fdf6f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/313170
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Cherry Mui <cherryyz@google.com>

2 years agocmd/dist: wait for exit in bgwait after a fatal error
Manlio Perillo [Sun, 16 May 2021 17:52:37 +0000 (19:52 +0200)]
cmd/dist: wait for exit in bgwait after a fatal error

Currently, when a command scheduled by bgrun fails, bgwait returns to
the caller even in case the fatal error was detected.

In case of a syntax error in one of the standard packages, as an
example, the runInstall function will try to read the generated archive
file, only to fail since the file does not exist.  Since the runInstall
function is called in a goroutine, cmd/dist will continue to report
errors until all background goroutines are done.

Update the bgwait function to wait until program termination in case of
a fatal error, since returning to the caller (with an error, as an
example) will cause cmd/dist to report an additional error during the
next build phase.

Fixes #45410

Change-Id: If89976abad70f8d6ec79b2a5a1f2306e9c034c5a
Reviewed-on: https://go-review.googlesource.com/c/go/+/320311
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>

2 years agoencoding/xml: add generic encoding test
Keith Randall [Tue, 12 Oct 2021 23:50:35 +0000 (16:50 -0700)]
encoding/xml: add generic encoding test

Fixes #48521

Change-Id: Id8402bcff243c0ab19e4ec0b138b9af8c111f88d
Reviewed-on: https://go-review.googlesource.com/c/go/+/355492
Trust: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
2 years agogo/types: clearer object string for type parameters
Robert Findley [Tue, 9 Nov 2021 19:10:37 +0000 (14:10 -0500)]
go/types: clearer object string for type parameters

This is a port of CL 361401 to go/types.

Change-Id: I5b1c7cf1d7a819b2902c304f884492ec02c7eaa1
Reviewed-on: https://go-review.googlesource.com/c/go/+/362737
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agocmd/compile: add line number test for #49436
David Chase [Tue, 9 Nov 2021 16:47:49 +0000 (11:47 -0500)]
cmd/compile: add line number test for #49436

This enhances the existing line number test
to allow a specific -gcflags (e.g., -G=3)
and to permit ignoring duplicate line numbers
(which is arguably a bug, but not THIS bug,
and it lowers the risk of a flaky test).

Limited to Linux/Darwin and amd64/arm64,
also tests with "unified" mangling.

And, using these new powers, adds a test.

Updates #49436.

Change-Id: I09c82e6a08d53edd5a752522a827e872d3e16e0b
Reviewed-on: https://go-review.googlesource.com/c/go/+/362714
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2 years agoall: update vendored golang.org/x/tools for Go 1.18 release
Dmitri Shuralyov [Tue, 9 Nov 2021 18:54:57 +0000 (13:54 -0500)]
all: update vendored golang.org/x/tools for Go 1.18 release

The Go 1.18 code freeze has recently started. This is a time to update
all golang.org/x/... module versions that contribute packages to the
std and cmd modules in the standard library to latest master versions.

This CL updates only the tools module, keeping mod unchanged because
its lastest commit isn't ready to be vendored yet.

For #36905.
Updates #49350.

Change-Id: Ib39713d28a55fc9ec79058aab9919eba912def5f
Reviewed-on: https://go-review.googlesource.com/c/go/+/361094
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agoall: update vendored golang.org/x/crypto for Go 1.18 release
Dmitri Shuralyov [Tue, 9 Nov 2021 18:49:45 +0000 (13:49 -0500)]
all: update vendored golang.org/x/crypto for Go 1.18 release

The Go 1.18 code freeze has recently started. This is a time to update
all golang.org/x/... module versions that contribute packages to the
std and cmd modules in the standard library to latest master versions.

This CL updates only the crypto module, as well as the TestDependencies
policy to accommodate the dependency order change done in CL 345649.
The next CL will update further modules.

For #36905.

Change-Id: If93160d8d72ca86e9995aaf5bdfc3d2c20b4695d
Reviewed-on: https://go-review.googlesource.com/c/go/+/362736
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2 years agoall: update vendored golang.org/x/{net,text} for Go 1.18 release
Dmitri Shuralyov [Tue, 9 Nov 2021 18:31:45 +0000 (13:31 -0500)]
all: update vendored golang.org/x/{net,text} for Go 1.18 release

The Go 1.18 code freeze has recently started. This is a time to update
all golang.org/x/... module versions that contribute packages to the
std and cmd modules in the standard library to latest master versions.

This CL updates only the net, text modules.
The next CL will update further ones.

For #36905.

Change-Id: I9a5ac3cca22da961cfd09f3202e01e1187d42bdd
Reviewed-on: https://go-review.googlesource.com/c/go/+/362735
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2 years agoall: update vendored golang.org/x/{arch,sys,term} for Go 1.18 release
Dmitri Shuralyov [Tue, 9 Nov 2021 18:31:45 +0000 (13:31 -0500)]
all: update vendored golang.org/x/{arch,sys,term} for Go 1.18 release

The Go 1.18 code freeze has recently started. This is a time to update
all golang.org/x/... module versions that contribute packages to the
std and cmd modules in the standard library to latest master versions.

This CL updates only the lower-level modules arch, sys, term for better
bisection. The next CL will update further ones.

For #36905.

Change-Id: I455428c051ec49b446b8b558a6f579cd9be4d796
Reviewed-on: https://go-review.googlesource.com/c/go/+/362734
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agoos: clarify that File.{Read,Write} use the buffer
Ian Lance Taylor [Tue, 9 Nov 2021 02:30:30 +0000 (18:30 -0800)]
os: clarify that File.{Read,Write} use the buffer

Fixes #49470

Change-Id: I81fd4b0e2eef1d8d430b5d1d10c4f824e803a75c
Reviewed-on: https://go-review.googlesource.com/c/go/+/362335
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2 years agobufio: document that NewWriter can return its argument
Ian Lance Taylor [Mon, 8 Nov 2021 21:57:50 +0000 (13:57 -0800)]
bufio: document that NewWriter can return its argument

Fixes #49446

Change-Id: Ib0b53a7dd5d567a2dd0bdf29f53d276587b60afb
Reviewed-on: https://go-review.googlesource.com/c/go/+/361921
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2 years agocmd/compile: NewSelectorExpr use n.Pos instead of base.Pos
Chaoqun Han [Mon, 8 Nov 2021 14:58:51 +0000 (22:58 +0800)]
cmd/compile: NewSelectorExpr use n.Pos instead of base.Pos

Fixes #49436

Change-Id: I4c8851e7aaee631d5eb22f2ef0aea5a25e936d87
Reviewed-on: https://go-review.googlesource.com/c/go/+/361917
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Trust: David Chase <drchase@google.com>

2 years agogo/types: make object test an external test
Robert Findley [Tue, 9 Nov 2021 16:19:20 +0000 (11:19 -0500)]
go/types: make object test an external test

This is a port of CL 361409 to go/types.

Change-Id: I17ccf8a5b4ba715fd8a87ea2c1811700fb1157e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/362538
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2 years agogo/types: check non-generic conversions first
Robert Findley [Tue, 9 Nov 2021 16:14:37 +0000 (11:14 -0500)]
go/types: check non-generic conversions first

This is a clean port of CL 361269 to go/types.

Change-Id: I2caaf08eabdf1707ae83ec1e628fd26f21b2b8e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/362616
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2 years agogo/types: minor cleanups in predicates.go
Robert Findley [Tue, 9 Nov 2021 16:09:13 +0000 (11:09 -0500)]
go/types: minor cleanups in predicates.go

This is a clean port of CL 360956 to go/types.

Change-Id: Iac437e72bb760e7e90236a86e7473d6a440df081
Reviewed-on: https://go-review.googlesource.com/c/go/+/362615
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2 years agocmd/link: fix GCC startfiles names on AIX
Clément Chigot [Tue, 9 Nov 2021 09:01:05 +0000 (10:01 +0100)]
cmd/link: fix GCC startfiles names on AIX

Since GCC version 11, the 64-bit version of GCC starting files are
now suffixed by "_64" instead of being stored without suffix under
"ppc64" multilib directory.

Change-Id: Ibe53521ed24d36e5f6282e3574849b9ae11a1e9a
Reviewed-on: https://go-review.googlesource.com/c/go/+/362594
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>

2 years agonet/http: add MaxBytesHandler
Carl Johnson [Tue, 31 Aug 2021 20:35:35 +0000 (20:35 +0000)]
net/http: add MaxBytesHandler

Fixes #39567

Change-Id: I226089b678a6a13d7ce69f360a23fc5bd297d550
GitHub-Last-Rev: 6435fd5881fc70a276d04df5a60440e365924b49
GitHub-Pull-Request: golang/go#48104
Reviewed-on: https://go-review.googlesource.com/c/go/+/346569
Trust: Damien Neil <dneil@google.com>
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
2 years agocmd/go: add //go:embed all:pattern
Russ Cox [Thu, 28 Oct 2021 17:22:07 +0000 (13:22 -0400)]
cmd/go: add //go:embed all:pattern

When //go:embed d matches directory d, it embeds the directory
tree rooted at d, but it excludes files beginning with . and _,
as well as files having problematic names that will not be packaged
into modules (names such as .git and com1).

After long discussions on #42328 and #43854, we decided to keep
the behavior of excluding . and _ files by default, but to allow the pattern
prefix 'all:' to override this default. This CL implements that change.

Note that paths like .git and com1 are still excluded, as they must be,
since they will never be packed into a module.

Fixes #43854.

Change-Id: I4f3731e14ecffd4b691fda3a0890b460027fe209
Reviewed-on: https://go-review.googlesource.com/c/go/+/359413
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2 years agoruntime: add upper half and carry bit with zero
Michael Pratt [Tue, 9 Nov 2021 16:35:52 +0000 (11:35 -0500)]
runtime: add upper half and carry bit with zero

https://golang.org/cl/246763 accidentally changed this from upper + 0 +
carry to upper + old vdsoSP + carry.

The old value of vdsoPC is usually zero, so this typically works.
However, the reentrant case will have a non-zero value, resulting in a
bogus returned time.

Fixes #49481

Change-Id: I0110b84277bf911804cb0ff8097aebf1b7eb100a
Reviewed-on: https://go-review.googlesource.com/c/go/+/362674
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 years agoruntime/pprof: include labels in profile dump
Michael Pratt [Tue, 9 Nov 2021 15:59:32 +0000 (10:59 -0500)]
runtime/pprof: include labels in profile dump

For tests of pprof label support having the sample labels in the output
is needed for effective debugging.

For #48577

Change-Id: Ic7c5bc90cb33e8fb477f7db62d9b56a7a9d6ffa8
Reviewed-on: https://go-review.googlesource.com/c/go/+/362614
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 years agocmd/compile/internal/types2: roll-forward removal of asX converters
Robert Findley [Mon, 8 Nov 2021 18:08:59 +0000 (18:08 +0000)]
cmd/compile/internal/types2: roll-forward removal of asX converters

This CL reverts CL 361964, rolling forward the original CL 362254 with a
fix for re-entrant expansion via type hashing (compare patchsets 1 and
2).

Change-Id: I62869e50e919f42eb8d6fef5b0d7a5ec8960bd84
Reviewed-on: https://go-review.googlesource.com/c/go/+/362118
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agocmd/compile: disable doubleCheck and remove unused checkDictionary
Dan Scales [Tue, 9 Nov 2021 02:10:30 +0000 (18:10 -0800)]
cmd/compile: disable doubleCheck and remove unused checkDictionary

In stencil.go, change doubleCheck to false, which will turn off some
double-checking code which isn't needed generally, now that we have lots
of tests of end-to-end runs.

Also, removed checkDictionary() which is unused and is unlikely to be
useful in the future.

Change-Id: I4e5acceab80f4904b174422bae21ca82cf04f943
Reviewed-on: https://go-review.googlesource.com/c/go/+/361923
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agogo/types: rename is_X predicates back to isX (step 2 of 2)
Robert Findley [Tue, 9 Nov 2021 15:20:50 +0000 (10:20 -0500)]
go/types: rename is_X predicates back to isX (step 2 of 2)

This is a port of CL 361134 to go/types.

Change-Id: Ibac4365a85561b32a90b0118d48aa9302f227b2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/362554
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2 years agogo/types: rename isX predicates to allX, add simple is_X (step 1 of 2)
Robert Findley [Mon, 8 Nov 2021 18:09:41 +0000 (13:09 -0500)]
go/types: rename isX predicates to allX, add simple is_X (step 1 of 2)

This is a port of CL 360955 to go/types. Note that go/types and types2
differ in handling of untyped nil within both Checker.shift and
Checker.implicitTypeAndValue.

A missing comment was added to Checker.indexExpr.

Change-Id: Ia9149ff9c0af68213c579090902ab7989828ddd2
Reviewed-on: https://go-review.googlesource.com/c/go/+/362534
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2 years agotesting: remove package from fuzz crasher message
Katie Hockman [Mon, 8 Nov 2021 17:13:01 +0000 (12:13 -0500)]
testing: remove package from fuzz crasher message

Fixes #48149

Change-Id: Iaf91d2c54fda809c7da90cdfb6d1d075f474c69b
Reviewed-on: https://go-review.googlesource.com/c/go/+/362116
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2 years agocmd/go: fix mod_get_direct
Cuong Manh Le [Tue, 9 Nov 2021 03:37:43 +0000 (10:37 +0700)]
cmd/go: fix mod_get_direct

https://github.com/googleapis/google-cloud-go has changed the default
branch from master to main, causing mod_get_direct failed on longtest.

Change-Id: I8fe0356b2ff532d1fdedbcb1e1832d7335babaa0
Reviewed-on: https://go-review.googlesource.com/c/go/+/361965
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2 years agoruntime: revert recent Windows crashdump changes
Jason A. Donenfeld [Tue, 9 Nov 2021 00:23:02 +0000 (01:23 +0100)]
runtime: revert recent Windows crashdump changes

Recent changes to runtime enabled crashdumps, which under some
circumstances apparently might result in memory being uploaded to
Microsoft. A change like this should go through the proper proposals
process where we can discuss how to gate it and what all of its
implications are.

This reverts CL 307372 and its cleanup CL 360617.

Change-Id: If2e74015899d746831da40546c82eacacdf739e1
Reviewed-on: https://go-review.googlesource.com/c/go/+/362454
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2 years agocmd/compile: remove unneeded "==" method in pre-defined "comparable" interface
Cuong Manh Le [Mon, 8 Nov 2021 08:51:05 +0000 (15:51 +0700)]
cmd/compile: remove unneeded "==" method in pre-defined "comparable" interface

Fixes #49421

Change-Id: Iecf3952346ecd278198c1000014a321e230f7fa7
Reviewed-on: https://go-review.googlesource.com/c/go/+/361962
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
2 years agocmd/compile: fix irgen mis-handling of ... argument when creating closure
Cuong Manh Le [Mon, 8 Nov 2021 06:08:58 +0000 (13:08 +0700)]
cmd/compile: fix irgen mis-handling of ... argument when creating closure

When bulding formal arguments of newly created closure, irgen forgets to
set "..." field attribute, causing type mismatched between the closure
function and the ONAME node represents that closure function.

Fixes #49432

Change-Id: Ieddaa64980cdd3d8cea236a5a9de0204ee21ee39
Reviewed-on: https://go-review.googlesource.com/c/go/+/361961
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
2 years agoRevert "cmd/go: add workspace pruning mode"
Bryan C. Mills [Mon, 8 Nov 2021 21:45:58 +0000 (21:45 +0000)]
Revert "cmd/go: add workspace pruning mode"

This reverts CL 357169.

Reason for revert: appears to be failing on longtest SlowBot.¹

¹https://storage.googleapis.com/go-build-log/a97c855b/linux-amd64-longtest_7c9857d4.log

Change-Id: I3b94395671db78ed5fb2fb1019e7199e4ffbd272
Reviewed-on: https://go-review.googlesource.com/c/go/+/362249
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agotest: add regress test for reported non-monomorphizable example
Matthew Dempsky [Mon, 8 Nov 2021 21:13:30 +0000 (13:13 -0800)]
test: add regress test for reported non-monomorphizable example

Fixes #48711.

Change-Id: I2ed1ef5267343d4b9f91da0618905098d178db90
Reviewed-on: https://go-review.googlesource.com/c/go/+/362394
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2 years agocmd/go: rename go mod initwork and editwork to go work init and edit
Michael Matloob [Thu, 21 Oct 2021 18:26:55 +0000 (14:26 -0400)]
cmd/go: rename go mod initwork and editwork to go work init and edit

This brings the workspace related commands into their own namespace.

Fixes #48256

Change-Id: I9d5e3d4c45798913d742c532c1571006e6f9cc57
Reviewed-on: https://go-review.googlesource.com/c/go/+/357611
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2 years agocmd/go: add workspace pruning mode
Michael Matloob [Tue, 19 Oct 2021 18:05:29 +0000 (14:05 -0400)]
cmd/go: add workspace pruning mode

This change corrects a bug in the handling of module loading of
workspaces. Namely, there is an assumption by the module pruning code
that if a root module is selected then the packages of that module can
be resolved without loading the whole module graph. This is not true
in workspace mode because two workspace modules can require different
versions of a dependency. Worse, one workspace module can directly
require a depencency that is transitively required by another
workspace module, changing the version of that module loaded in the
fully expanded graph.

To correct this, a new 'workspace' pruning mode is added where the
roots are the workspace modules themselves, satisfying the assumption
made by the module pruning logic.

The rest of this change accounts for the new pruning mode where it's
used and correctly sets the requirements in this pruning mode.

Change-Id: I5d4d9877e492e196681f6ee9f8f18a08b4e95c61
Reviewed-on: https://go-review.googlesource.com/c/go/+/357169
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2 years agonet/http: deflake TestTimeoutHandlerContextCanceled
Damien Neil [Mon, 8 Nov 2021 20:45:41 +0000 (12:45 -0800)]
net/http: deflake TestTimeoutHandlerContextCanceled

Fixes #49448

Change-Id: Ie2acff7dedbca9bd1cc0b1b3dd0a01573c7befee
Reviewed-on: https://go-review.googlesource.com/c/go/+/361920
Trust: Damien Neil <dneil@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2 years agocmd/compile,cmd/go: fix long test builders
Cuong Manh Le [Mon, 8 Nov 2021 17:05:58 +0000 (00:05 +0700)]
cmd/compile,cmd/go: fix long test builders

CL 361411 improved error message for go version requirement, but forgot
to update the test in cmd/go to match new error message. That causes
longtest builders failed.

This CL changes mod_vendor_goversion.txt to match compiler error, and
limit fixedbugs/issue49368.go to run with -G=3 only.

Updates #49368

Change-Id: I125fe0a8c2a1595066d39c03e97819e7a1274e0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/361963
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2 years agocmd/compile: Revert "cmd/compile/internal/types2: remove most asX converters (cleanup)"
Cuong Manh Le [Mon, 8 Nov 2021 17:34:18 +0000 (00:34 +0700)]
cmd/compile: Revert "cmd/compile/internal/types2: remove most asX converters (cleanup)"

This reverts commit 759eaa22adb0ab883959e4a36c19f2dfe77b5895.

Reason to revert: break unified IR builder

Though the unified IR is not for go1.18, it's the only user of types2
lazy resolution APIs at this moment. And it consistently failed after
CL 362254 is the sign that the change was wrong somehow.

Change-Id: I6bfc3192904fe2129fd3c165f0df8761e8eb441c
Reviewed-on: https://go-review.googlesource.com/c/go/+/361964
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2 years agocrypto/x509: remove ios build tag restriction
Roland Shoemaker [Mon, 8 Nov 2021 16:05:24 +0000 (08:05 -0800)]
crypto/x509: remove ios build tag restriction

Fixes #49435

Change-Id: I77ce12f447e727e7dc3b23de947357c27a268bd2
Reviewed-on: https://go-review.googlesource.com/c/go/+/362294
Trust: Roland Shoemaker <roland@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2 years agointernal/fmtsort: order channels in test in memory address order
Keith Randall [Mon, 8 Nov 2021 05:29:30 +0000 (21:29 -0800)]
internal/fmtsort: order channels in test in memory address order

Kind of a kludge, but it makes the test work reliably.

Fixes #49431

Change-Id: Ic2a075ba02f80ea7efcc1b3f0f5a43649e87c0d8
Reviewed-on: https://go-review.googlesource.com/c/go/+/361918
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2 years agoruntime: disable GC in TestPanicSystemstack's subprocess
Michael Anthony Knyszek [Fri, 5 Nov 2021 23:47:51 +0000 (23:47 +0000)]
runtime: disable GC in TestPanicSystemstack's subprocess

TestPanicSystemstack spins up a subprocess that has 2 goroutines
deadlock on a runtime lock while on the system stack, with GOMAXPROCS=2.

Each goroutine is going to be running on a P, and then is going to wedge
itself up on that P.

If a GC is active and a worker starts executing (using a P), then it
could try to preempt a goroutine that is already blocked. It won't be
able to, so it'll just sit there forever trying to suspend it. At this
point there are no more Ps to execute the remaining goroutine that needs
to print something so the parent process can continue the test.

This change fixes this issue by disabling GCs in the child process. An
alternative fix could be to increase GOMAXPROCS in the child, but maybe
letting the GC be on (which assumes it'll always be able to *eventually*
suspend a G) is just asking for trouble.

Fixes #49388.

Change-Id: I405c9dad50e24e1e68f2c52a646538da15797fbe
Reviewed-on: https://go-review.googlesource.com/c/go/+/361897
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
2 years agoruntime: disable GC during debug call tests
Michael Anthony Knyszek [Fri, 5 Nov 2021 23:35:58 +0000 (23:35 +0000)]
runtime: disable GC during debug call tests

Currently the debug call protocol implementation we use for testing is
riddled with write barriers, and called from a signal handler. This is
not safe, as write barriers need a P to execute.

Ideally this implementation would be rewritten to avoid the write
barriers, but it's not straightforward, and needs some thought. As a
temporary measure, disable GC during the debug call tests to avoid a
write barrier.

Note that this does not indicate a problem with real use of the debug
call protocol. Only our test implementation has this issue, because it
needs to get executed in a signal handler, normally a separate process
is interfacing with the protocol via process signals and ptrace (and the
like).

Fixes #49370.

Change-Id: Ic0fde5d0f4c64f9ecc9789b7dabb3954538fe0a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/361896
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
2 years agocmd/compile/internal/types2: remove most asX converters (cleanup)
Robert Griesemer [Mon, 8 Nov 2021 04:08:13 +0000 (20:08 -0800)]
cmd/compile/internal/types2: remove most asX converters (cleanup)

Make it explicit in the code where we call under.
The asNamed and asTypeParam converters need to
stay: asNamed does resolution if necessary, and
asTypeParam may or may not call under() depending
on the next CL.

Reviewed uses of asNamed and .(*Named) for correctness.
Removed unnecessary Named.resolve call in lookup.

Change-Id: I2acf176925e00bd1703a00230a779aa65a8f5a51
Reviewed-on: https://go-review.googlesource.com/c/go/+/362254
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2 years agocmd/compile/internal/types2: use compiler version error when configured for compiler
Robert Griesemer [Fri, 5 Nov 2021 03:00:51 +0000 (20:00 -0700)]
cmd/compile/internal/types2: use compiler version error when configured for compiler

Fixes #49368.

Change-Id: I7c7575ae8bb6271160747e3f1888b144c3ab24c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/361411
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2 years agodoc/go1.18: strings,bytes: deprecate Title
smasher164 [Sat, 6 Nov 2021 06:59:00 +0000 (02:59 -0400)]
doc/go1.18: strings,bytes: deprecate Title

Updates #48367.

Change-Id: Ib8fc6d9dd7c3c6a70fefe077615f51a71d9c42ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/361899
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>

2 years agonet/http: fix spelling in documentation
jiahua wang [Fri, 8 Oct 2021 01:59:15 +0000 (09:59 +0800)]
net/http: fix spelling in documentation

Change-Id: I8b0924300eafe27de98975512a78a6527a92e446
Reviewed-on: https://go-review.googlesource.com/c/go/+/354729
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Damien Neil <dneil@google.com>

2 years agoarchive/zip: don't read data descriptor early
Arran Walker [Thu, 21 Oct 2021 09:39:05 +0000 (10:39 +0100)]
archive/zip: don't read data descriptor early

Go 1.17 introduced an unnecessary change to when a zip's data descriptor
is read for file entries, how it is parsed and how the crc32 field is
used.

Before Go 1.17, the data descriptor was read immediately after a file
entry's content. This continuous read is a pattern existing applications
have come to rely upon (for example, where reads at specific offsets
might be translated to HTTP range requests).

In Go 1.17, all data descriptors are immediately read upon opening the
file. This results in scattered and non-continuous reads of the archive,
and depending on the underlying reader, might have severe performance
implications. In addition, an additional object is now initialized for
each entry, but is mostly redundant.

Previously, the crc32 field in the data descriptor would return an error
if it did not match the central directory's entry. This check has
seemingly been unintentionally removed. If the central directory crc32
is invalid and a data descriptor is present, no error is returned.

This change reverts to the previous handling of data descriptors, before
CL 312310.

Fixes #48374
Fixes #49089

Change-Id: I5df2878c4fcc9e500064e7175f3ab9727c82f100
Reviewed-on: https://go-review.googlesource.com/c/go/+/357489
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>

2 years agocmd/compile/internal/types2: report error for incomplete struct composite literal...
Robert Griesemer [Fri, 5 Nov 2021 04:31:08 +0000 (21:31 -0700)]
cmd/compile/internal/types2: report error for incomplete struct composite literal type

Mark a struct as "complete" with a non-nil (but possibly zero length)
fields list. Add a test when type-checking struct composite literals,
the same way we do for other composite literal types.

Fixes #49276.

Change-Id: If44a3d790bf7032ddcd155af49bdc47b1cdff4fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/361412
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2 years agocmd/compile/internal/types2: clearer object string for type parameters
Robert Griesemer [Thu, 4 Nov 2021 19:50:25 +0000 (12:50 -0700)]
cmd/compile/internal/types2: clearer object string for type parameters

- print "type parameter" rather than just "type"
- print the type bound rather than the underlying type
- added an object string test

Change-Id: Ibb572ff35b74f2c6ccb27641154f096770541130
Reviewed-on: https://go-review.googlesource.com/c/go/+/361401
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2 years agocmd/compile/internal/types2: make object test an external test
Robert Griesemer [Thu, 4 Nov 2021 23:00:34 +0000 (16:00 -0700)]
cmd/compile/internal/types2: make object test an external test

Change-Id: I15c969a799404067f34f600da15b1a97d4857315
Reviewed-on: https://go-review.googlesource.com/c/go/+/361409
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2 years agocmd/compile/internal/types2: always parse tests assuming generic code
Robert Griesemer [Thu, 4 Nov 2021 23:22:49 +0000 (16:22 -0700)]
cmd/compile/internal/types2: always parse tests assuming generic code

We don't need to distinguish anymore as this is the new default.
This removes the need to prefix test package names with "generic_".

Change-Id: If9eaa0a5cffcd19deb529aca6798206f2d396ca1
Reviewed-on: https://go-review.googlesource.com/c/go/+/361408
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2 years agocrypto/x509: verification with system and custom roots
Roland Shoemaker [Fri, 1 Oct 2021 17:14:32 +0000 (10:14 -0700)]
crypto/x509: verification with system and custom roots

Make system cert pools special, such that when one has extra roots
added to it we run verifications twice, once using the platform
verifier, if available, and once using the Go verifier, merging the
results.

This change re-enables SystemCertPool on Windows, but explicitly does
not return anything from CertPool.Subjects (which matches the behavior
of macOS). CertPool.Subjects is also marked deprecated.

Fixes #46287
Fixes #16736

Change-Id: Idc1843f715ae2b2d0108e55ab942c287181a340a
Reviewed-on: https://go-review.googlesource.com/c/go/+/353589
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Trust: Roland Shoemaker <roland@golang.org>

2 years agocmd/compile: avoid adding LECall to the entry block when has opendefers
hanpro [Fri, 5 Nov 2021 01:47:54 +0000 (09:47 +0800)]
cmd/compile: avoid adding LECall to the entry block when has opendefers

The openDeferRecord always insert vardef/varlive pairs into the entry block, it may destroy the mem chain when LECall's args are writing into the same block. So create a new block before that happens.

Fixes #49282

Change-Id: Ibda6c4a45d960dd412a641f5e02276f663c80785
Reviewed-on: https://go-review.googlesource.com/c/go/+/361410
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Trust: Than McIntosh <thanm@google.com>
Reviewed-by: David Chase <drchase@google.com>
2 years agoall: remove more leftover // +build lines
Tobias Klauser [Sat, 6 Nov 2021 10:09:56 +0000 (11:09 +0100)]
all: remove more leftover // +build lines

CL 344955 and CL 359476 removed almost all // +build lines, but leaving
some assembly files and generating scripts. Also, some files were added
with // +build lines after CL 359476 was merged. Remove these or rename
files where more appropriate.

For #41184

Change-Id: I7eb85a498ed9788b42a636e775f261d755504ffa
Reviewed-on: https://go-review.googlesource.com/c/go/+/361480
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2 years agocrypto/x509: use the platform verifier on iOS
Roland Shoemaker [Fri, 1 Oct 2021 16:14:10 +0000 (09:14 -0700)]
crypto/x509: use the platform verifier on iOS

Use the same certificate verification APIs on iOS as on macOS (they
share the same APIs, so we should be able to transparently use them
on both.)

Updates #46287
Fixes #38843

Change-Id: If70f99b0823dd5fa747c42ff4f20c3b625605327
Reviewed-on: https://go-review.googlesource.com/c/go/+/353403
Trust: Roland Shoemaker <roland@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>

2 years agoruntime: eliminate rendundant loads gcPercent
Michael Anthony Knyszek [Thu, 21 Oct 2021 21:26:50 +0000 (21:26 +0000)]
runtime: eliminate rendundant loads gcPercent

The previous change was an automated change that made gcPercent a
type-safe atomic variable. However, that introduced a lot of redundant
formal atomic loads of the variable. Remove them by only loading once in
each case, and reusing the value.

Change-Id: I49647135f423574f94506d456d1cc390150fad02
Reviewed-on: https://go-review.googlesource.com/c/go/+/357795
Trust: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2 years agoruntime: retype gcControllerState.gcPercent as atomic.Int32
Michael Anthony Knyszek [Thu, 21 Oct 2021 21:19:23 +0000 (21:19 +0000)]
runtime: retype gcControllerState.gcPercent as atomic.Int32

[git-generate]
cd src/runtime
mv export_test.go export.go
GOROOT=$(dirname $(dirname $PWD)) rf '
  add gcControllerState.gcPercent \
// Initialized from GOGC. GOGC=off means no GC. \
gcPercent_ atomic.Int32
  ex {
    import "runtime/internal/atomic"

    var t gcControllerState
    var v, w int32
    var d int32

    t.gcPercent -> t.gcPercent_.Load()
    t.gcPercent = v -> t.gcPercent_.Store(v)
    atomic.Loadint32(&t.gcPercent) -> t.gcPercent_.Load()
    atomic.Storeint32(&t.gcPercent, v) -> t.gcPercent_.Store(v)
    atomic.Xaddint32(&t.gcPercent, d) -> t.gcPercent_.Add(d)
    atomic.Casint32(&t.gcPercent, v, w) -> t.gcPercent_.CompareAndSwap(v, w)
    atomic.Xchgint32(&t.gcPercent, v) -> t.gcPercent_.Swap(v)
  }
  rm gcControllerState.gcPercent
  mv gcControllerState.gcPercent_ gcControllerState.gcPercent
'
mv export.go export_test.go

Change-Id: I1aae34a3f782d096c6b6233bbf7986e67ce9c5f9
Reviewed-on: https://go-review.googlesource.com/c/go/+/357794
Trust: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2 years agonet/netip: document the zero Addr
Josh Bleecher Snyder [Fri, 5 Nov 2021 21:55:52 +0000 (14:55 -0700)]
net/netip: document the zero Addr

Fixes #49364

Change-Id: I3372f80723a4deae48ef106f88b0ad880cdd0e45
Reviewed-on: https://go-review.googlesource.com/c/go/+/361914
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2 years agodoc/go1.18: split bytes and strings packages
Dmitri Shuralyov [Fri, 5 Nov 2021 22:40:03 +0000 (18:40 -0400)]
doc/go1.18: split bytes and strings packages

A small touchup after CL 361894.

For #47694.

Change-Id: Ifc161516f897f727195d21351a3c8eda7b6e327e
Reviewed-on: https://go-review.googlesource.com/c/go/+/361895
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Carlos Amedee <carlos@golang.org>

2 years agonet/netip: add tests for Addr.AsSlice
Josh Bleecher Snyder [Fri, 5 Nov 2021 22:34:20 +0000 (15:34 -0700)]
net/netip: add tests for Addr.AsSlice

Change-Id: Ib88dd101b3bbdf4d2bfd79838994cfadef1b604d
Reviewed-on: https://go-review.googlesource.com/c/go/+/361915
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agonet/netip: add IPv4Unspecified
Jason A. Donenfeld [Wed, 3 Nov 2021 15:46:44 +0000 (16:46 +0100)]
net/netip: add IPv4Unspecified

There is IPv6Unspecified but there is not IPv4Unspecified, making for
inconsistent code. This commit adds the missing function.

Updates #49298.

Change-Id: Id2519b646323642f59fb1cc6ea8e335fdde16290
Reviewed-on: https://go-review.googlesource.com/c/go/+/361056
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2 years agonet/netip: reduce allocations in MarshalBinary
Jason A. Donenfeld [Wed, 3 Nov 2021 14:16:01 +0000 (15:16 +0100)]
net/netip: reduce allocations in MarshalBinary

Addr's MarshalBinary required two allocations in the case of a zone
existing, and AddrPort and Prefix both required three. This refactors
things slightly so that each marshal function only needs a single
allocation.

Change-Id: I9bde9969fedc1cad64bebb607188c4287f6a0d01
Reviewed-on: https://go-review.googlesource.com/c/go/+/361054
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2 years agocrypto/x509: use platform verifier on darwin
Roland Shoemaker [Wed, 29 Sep 2021 18:31:01 +0000 (11:31 -0700)]
crypto/x509: use platform verifier on darwin

When VerifyOptions.Roots is nil, default to using the platform X.509
certificate verification APIs on darwin, rather than using the Go
verifier. Since our oldest supported version of macOS is 10.12, we are
able to use the modern verification APIs, and don't need to resort to
the complex chain building trickery employed by chromium et al.

Unfortunately there is not a clean way to programmatically add test
roots to the system trust store that the builders would tolerate. The
most obvious solution, using 'security add-trusted-cert' requires human
interaction for authorization. We could also manually add anchors to
the constructed SecTrustRef, but that would require adding a whole
bunch of plumbing for test functionality, and would mean we weren't
really testing the actual non-test path. The path I've chosen here is
to just utilize existing valid, and purposefully invalid, trusted
chains, from google.com and the badssl.com test suite. This requires
external network access, but most accurately reflects real world
contexts.

This change removes the x509.SystemCertPool() functionality, which will
be ammended in a follow-up change which supports the suggested hybrid
pool approach described in #46287.

Updates #46287
Fixes #42414
Fixes #38888
Fixes #35631
Fixes #19561

Change-Id: I17f0d6c5cb3ef8a1f2731ce3296478b28d30df46
Reviewed-on: https://go-review.googlesource.com/c/go/+/353132
Trust: Roland Shoemaker <roland@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agonet/netip: add missing encoding.BinaryUnmarshaler to AddrPort and Prefix
Jason A. Donenfeld [Tue, 2 Nov 2021 20:33:23 +0000 (21:33 +0100)]
net/netip: add missing encoding.BinaryUnmarshaler to AddrPort and Prefix

The Addr type got an encoding.BinaryUnmarshaler implementation, but not
AddrPort and Prefix. This commit adds the missing implementation of that
interface to these types. It also adds two round trip tests that follow
the template of the existing one for Addr.

Updates #49298.

Change-Id: Iac633aed8aac579960815bb64d06ff3181214841
Reviewed-on: https://go-review.googlesource.com/c/go/+/360875
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2 years agonet/netip: add Addr.AsSlice() method
Jason A. Donenfeld [Tue, 2 Nov 2021 19:44:32 +0000 (20:44 +0100)]
net/netip: add Addr.AsSlice() method

We have AddrFrom4, AddrFrom6, AddrFromSlice and As4, As6, but we are
missing AsSlice, so this commit adds the missing function. It also gets
rid of the less ergonomic and inconsistently named IPAddrParts.

Updates #49298.

Change-Id: I1c6a2c32fc6c69b244ab49765412ffe3bbe7e5c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/360874
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2 years agonet: accept "." as a valid domain name
Filippo Valsorda [Mon, 1 Nov 2021 03:22:38 +0000 (23:22 -0400)]
net: accept "." as a valid domain name

Fixes #45715

Change-Id: Ibdaa91c97d34473061b377325ebe9a3bf5696c8e
Reviewed-on: https://go-review.googlesource.com/c/go/+/360314
Trust: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2 years agocrypto/tls: set default minimum client version to TLS 1.2
Filippo Valsorda [Mon, 1 Nov 2021 03:13:18 +0000 (23:13 -0400)]
crypto/tls: set default minimum client version to TLS 1.2

Updates #45428

Change-Id: I5d70066d4091196ec6f8bfc2edf3d78fdc0520c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/359779
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2 years agodoc/go1.18: fill in Go 1.18 release note TODOs using relnote
Dmitri Shuralyov [Fri, 5 Nov 2021 21:29:58 +0000 (17:29 -0400)]
doc/go1.18: fill in Go 1.18 release note TODOs using relnote

For #47694.

Change-Id: Ia80a1859bd0fc6f08d27293f519c22fd9a804fd2
Reviewed-on: https://go-review.googlesource.com/c/go/+/361894
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Carlos Amedee <carlos@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2 years agocmd/go: fix bugs in replacement path handling
Michael Matloob [Tue, 19 Oct 2021 18:05:29 +0000 (14:05 -0400)]
cmd/go: fix bugs in replacement path handling

These are tested in golang.org/cl/357169 and golang.org/cl/358540.

Change-Id: I5add3f202db71731487f2688234c547abe1fd287
Reviewed-on: https://go-review.googlesource.com/c/go/+/361416
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2 years agocrypto/x509: disable SHA-1 signature verification
Filippo Valsorda [Sun, 31 Oct 2021 23:23:14 +0000 (19:23 -0400)]
crypto/x509: disable SHA-1 signature verification

Updates #41682

Change-Id: Ib766d2587d54dd3aeff8ecab389741df5e8af7cc
Reviewed-on: https://go-review.googlesource.com/c/go/+/359777
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2 years agonet/http: adjust a substring which matches "uninteresting" goroutine
Nevkontakte [Sat, 23 Oct 2021 14:02:25 +0000 (14:02 +0000)]
net/http: adjust a substring which matches "uninteresting" goroutine

This change allows the check to pass unmodified under GopherJS, which
stack traces are formatted differently (due to being generated by
NodeJS). There are no other functions named `interestingGoroutines` in
the standard library, so it's very unlikely to create false negatives,
and will allow reduce the number of overlays GopherJS needs to maintain.

Change-Id: I925594c6c313ca35805811f240c8528241950547
GitHub-Last-Rev: 26b32efb225c1ee85de0a51968c31b1a58d56f92
GitHub-Pull-Request: golang/go#49128
Reviewed-on: https://go-review.googlesource.com/c/go/+/358154
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Trust: Damien Neil <dneil@google.com>
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agounicode/utf8: add AppendRune Example
jiahua wang [Thu, 7 Oct 2021 07:30:03 +0000 (15:30 +0800)]
unicode/utf8: add AppendRune Example

Also, correct TestAppendRune error message.

Change-Id: I3ca3ac7051af1ae6d449381b78efa86c2f6be8ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/354529
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Trust: Robert Findley <rfindley@google.com>
Trust: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

2 years agoerrors: add errors.Unwrap example
jiahua wang [Wed, 13 Oct 2021 14:16:37 +0000 (22:16 +0800)]
errors: add errors.Unwrap example

Change-Id: Id2336a6059f7a8d627e6c0661a4d4c05485b65f3
Reviewed-on: https://go-review.googlesource.com/c/go/+/355589
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Cherry Mui <cherryyz@google.com>
Trust: Robert Findley <rfindley@google.com>