]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
3 years agolib/time, time/tzdata: update tzdata to 2020e
Alberto Donizetti [Wed, 23 Dec 2020 08:30:22 +0000 (09:30 +0100)]
lib/time, time/tzdata: update tzdata to 2020e

Changelog:

  Volgograd switches to Moscow time on 2020-12-27 at 02:00.
  Small changes to past timestamps and abbreviations.

See

  http://mm.icann.org/pipermail/tz-announce/2020-December/000063.html

Updates #22487

Change-Id: I709abe899ca498698463e945ccbcf4bc5fe60b92
Reviewed-on: https://go-review.googlesource.com/c/go/+/279794
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agocmd/go: add the Retract field to 'go help mod edit' definition of the GoMod struct
markruler [Tue, 22 Dec 2020 17:22:17 +0000 (17:22 +0000)]
cmd/go: add the Retract field to 'go help mod edit' definition of the GoMod struct

Fixes #43281

Change-Id: Ife26ca174a8818b56aaea9547976d97978478a5f
GitHub-Last-Rev: 85a3d30001672b371a58d1c8a2092fc9b937af6f
GitHub-Pull-Request: golang/go#43315
Reviewed-on: https://go-review.googlesource.com/c/go/+/279592
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Trust: Jay Conrod <jayconrod@google.com>

3 years agodoc: fix a typo in contribute.html
Andrey Bokhanko [Mon, 21 Dec 2020 16:33:55 +0000 (16:33 +0000)]
doc: fix a typo in contribute.html

A fix for a trivial (yet still confusing for neophytes like me!) typo in
contribute.html.

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

3 years agocmd/go: in 'go get', promote named implicit dependencies to explicit
Jay Conrod [Wed, 16 Dec 2020 21:37:56 +0000 (16:37 -0500)]
cmd/go: in 'go get', promote named implicit dependencies to explicit

'go get pkg@vers' will now add an explicit requirement for the module
providing pkg if that version was already indirectly required.

'go get mod@vers' will do the same if mod is a module path but not a
package.

Requirements promoted this way will be marked "// indirect" because
'go get' doesn't know whether they're needed to build packages in the
main module. So users should prefer to run 'go get ./pkg' (where ./pkg
is a package in the main module) to promote requirements.

Fixes #43131

Change-Id: Ifbb65b71274b3cc752a7a593d6ddd875f7de23b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/278812
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
3 years agoos/signal: fix a deadlock with syscall.AllThreadsSyscall() use
Andrew G. Morgan [Sat, 12 Dec 2020 06:42:11 +0000 (22:42 -0800)]
os/signal: fix a deadlock with syscall.AllThreadsSyscall() use

The syscall.AllThreadsSyscall() fixup mechanism needs to cooperate
with signal handling to ensure a notetsleepg() thread can wake up
to run the mDoFixup() function.

Fixes #43149

Change-Id: I6651b25bc44a4de47d3fb71d0293d51aef8b79c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/277434
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agoruntime: linux iscgo support for not blocking nptl signals
Andrew G. Morgan [Fri, 13 Nov 2020 05:19:52 +0000 (21:19 -0800)]
runtime: linux iscgo support for not blocking nptl signals

Under linux+cgo, OS threads are launched via pthread_create().
This abstraction, under linux, requires we avoid blocking
signals 32,33 and 34 indefinitely because they are needed to
reliably execute POSIX-semantics threading in glibc and/or musl.

When blocking signals the go runtime generally re-enables them
quickly. However, when a thread exits (under cgo, this is
via a return from mstart()), we avoid a deadlock in C-code by
not blocking these three signals.

Fixes #42494

Change-Id: I02dfb2480a1f97d11679e0c4b132b51bddbe4c14
Reviewed-on: https://go-review.googlesource.com/c/go/+/269799
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Trust: Tobias Klauser <tobias.klauser@gmail.com>

3 years agocmd/go/internal/modload: add hint for missing implicit dependency
Jay Conrod [Tue, 22 Dec 2020 21:57:46 +0000 (16:57 -0500)]
cmd/go/internal/modload: add hint for missing implicit dependency

By default (and with -mod=readonly), the go command imports an error
if a package provided by an implicitly required module is
imported by a package in the main module. This import requires an
update to go.mod: the module must be required explicitly.

The package loader now provides a hint that 'go get' should be run on
the importing package. This is preferred to 'go get' on the imported
package, since that would add an "// indirect" requirement.

For #43131

Change-Id: I0b353ce8ac8c4ddf1a9863544dfaf6c1964daf42
Reviewed-on: https://go-review.googlesource.com/c/go/+/279528
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
3 years agocmd/link: handle grouped resource sections
Jason A. Donenfeld [Sun, 8 Nov 2020 10:57:42 +0000 (11:57 +0100)]
cmd/link: handle grouped resource sections

The Go PE linker does not support enough generalized PE logic to
properly handle .rsrc sections gracefully. Instead a few things are
special cased for these. The linker also does not support PE's "grouped
sections" features, in which input objects have several named sections
that are sorted, merged, and renamed in the output file. In the past,
more sophisticated support for resources or for PE features like grouped
sections have not been necessary, as Go's own object formats are pretty
vanilla, and GNU binutils also produces pretty vanilla objects where all
sections are already merged.

However, GNU binutils is lagging with arm support, and here LLVM has
picked up the slack. In particular, LLVM has its own rc/cvtres combo,
which are glued together in mingw LLVM distributions as windres, a
command line compatible tool with binutils' windres, which supports arm
and arm64. But there's a key difference between binutils' windres and
LLVM's windres: the LLVM one uses proper grouped sections.

So, this commit adds grouped sections support for resource sections to
the linker. We don't attempt to plumb generic support for grouped
sections, just as there isn't generic support already for what resources
require. Instead we augment the resource handling logic to deal with
standard two-section resource objects.

We also add a test for this, akin to the current test for more vanilla
binutils resource objects, and make sure that the rsrc tests are always
performed.

Fixes #42866.
Fixes #43182.

Change-Id: I059450021405cdf2ef1c195ddbab3960764ad711
Reviewed-on: https://go-review.googlesource.com/c/go/+/268337
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>

3 years agotest: trigger SIGSEGV instead of SIGTRAP in issue11656.go
Cherry Zhang [Mon, 21 Dec 2020 23:41:16 +0000 (18:41 -0500)]
test: trigger SIGSEGV instead of SIGTRAP in issue11656.go

In issue11656.go, it tests that if the runtime can get a
reasonable traceback when it faults at a non-function PC. It does
it by jumping to an address that contains an illegal or trap
instruction. When it traps, the SIGTRAP crashes the runtime.

This CL changes it to use an instruction that triggers SIGSEGV.
This is due to two reasons:
- currently, the handling of bad PC is done by preparePanic,
  which is only used for a panicking signal (SIGSEGV, SIGBUS,
  SIGFPE), not a fatal signal (e.g. SIGTRAP).
- the test uses defer+recover to get a traceback, which only
  works for panicking signals, not fatal signals.

Ideally, we should handle all kinds of faults (SIGSEGV, SIGBUS,
SIGILL, SIGTRAP, etc.) with a nice traceback. I'll leave this
for the future.

This CL also adds RISCV64 support.

Fixes #43283.

Change-Id: I5e0fbf8530cc89d16e05c3257d282bc1d4d03405
Reviewed-on: https://go-review.googlesource.com/c/go/+/279423
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agocmd/pack: r command create output file if not exist
Cherry Zhang [Tue, 22 Dec 2020 17:40:32 +0000 (12:40 -0500)]
cmd/pack: r command create output file if not exist

Go 1.15 pack's r command creates the output file if it does not
exist. The system "ar" command does this as well. Do the same.

For bazelbuild/rules_go#2762.

Change-Id: Icd88396b5c714b735c859a29ab29851e4301f4d2
Reviewed-on: https://go-review.googlesource.com/c/go/+/279516
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

3 years agoruntime: correct error handling in several FreeBSD syscall wrappers
Nikhil Benesch [Wed, 9 Dec 2020 20:14:59 +0000 (15:14 -0500)]
runtime: correct error handling in several FreeBSD syscall wrappers

The FreeBSD syscall convention uses the carry flag to indicate whether
an error has occured. The sys_umtx_op, thr_new, and pipe2 syscall
wrappers were failing to account for this convention and silently
suppressing errors as a result. This commit corrects these wrappers
by copying the pattern used by the other fallible syscall wrappers.

Note that futexsleep1 must now explicitly ignore the ETIMEDOUT error
from sys_umtx_op. Previously ETIMEDOUT was implicitly ignored because
sys_umtx_op never returned an error.

Fixes #43106.

Change-Id: I9c422b87cf4c6d308003bf42c3b419f785578b5d
Reviewed-on: https://go-review.googlesource.com/c/go/+/276892
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Trust: Than McIntosh <thanm@google.com>

3 years agocmd/pack: treat compiler's -linkobj output as "compiler object"
Cherry Zhang [Mon, 21 Dec 2020 19:11:02 +0000 (14:11 -0500)]
cmd/pack: treat compiler's -linkobj output as "compiler object"

Treat the compiler's -linkobj output as "compiler object, which
means "pack c" will "see through" the file and add individual
entry to the new archive, instead of the object as a whole.

This is somewhat peculiar. But Go 1.15's cmd/pack does this,
although seemingly accidental. We just do the same. FWIW, it
does make things more consistent with/without -linkobj flag.

Fixes #43271.

Change-Id: I6b2d99256db7ebf0fa430f85afa7464e334f6bcb
Reviewed-on: https://go-review.googlesource.com/c/go/+/279483
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
3 years agosyscall: don't generate ptrace on iOS
Cherry Zhang [Mon, 21 Dec 2020 18:14:41 +0000 (13:14 -0500)]
syscall: don't generate ptrace on iOS

May fix #43302.

Change-Id: I6b7ddf94495c4fa80cf8a50a38eef5f8b2872669
Reviewed-on: https://go-review.googlesource.com/c/go/+/279481
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agoruntime/metrics: add Read examples
Michael Anthony Knyszek [Mon, 7 Dec 2020 15:11:46 +0000 (15:11 +0000)]
runtime/metrics: add Read examples

This change adds two examples of using the Read function: one that reads
one metric and one that reads all metrics.

Change-Id: I4940a44c9b1d65f3f7a1554e3145ff07e6492fc1
Reviewed-on: https://go-review.googlesource.com/c/go/+/275855
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Trust: Michael Knyszek <mknyszek@google.com>

3 years agoruntime: use _exit on darwin
Cherry Zhang [Thu, 12 Nov 2020 02:27:56 +0000 (21:27 -0500)]
runtime: use _exit on darwin

On darwin, where we use libc for syscalls, when the runtime exits,
it calls libc exit function, which may call back into user code,
e.g. invoking functions registered with atexit. In particular, it
may call back into Go. But at this point, the Go runtime is
already exiting, so this wouldn't work.

On non-libc platforms we use exit syscall directly, which doesn't
invoke any callbacks. Use _exit on darwin to achieve the same
behavior.

No test for now, as it doesn't pass on all platforms (see trybot
run of PS2).

May fix #42465.
May fix #43294.

Change-Id: Ia1ada22b5da8cb64fdd598d0541eb90e195367eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/269378
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agoruntime: detect netbsd netpoll overrun in sysmon
Michael Pratt [Fri, 11 Dec 2020 19:14:30 +0000 (14:14 -0500)]
runtime: detect netbsd netpoll overrun in sysmon

The netbsd kernel has a bug [1] that occassionally prevents netpoll from
waking with netpollBreak, which could result in missing timers for an
unbounded amount of time, as netpoll can't restart with a shorter delay
when an earlier timer is added.

Prior to CL 232298, sysmon could detect these overrun timers and
manually start an M to run them. With this fallback gone, the bug
actually prevents timer execution indefinitely.

As a workaround, we add back sysmon detection only for netbsd.

[1] https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=50094

Updates #42515

Change-Id: I8391f5b9dabef03dd1d94c50b3b4b3bd4f889e66
Reviewed-on: https://go-review.googlesource.com/c/go/+/277332
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Trust: Michael Pratt <mpratt@google.com>

3 years agoruntime: skip wakep call in wakeNetPoller on Plan 9
Richard Miller [Sat, 5 Dec 2020 19:53:08 +0000 (19:53 +0000)]
runtime: skip wakep call in wakeNetPoller on Plan 9

This was part of a performance improvement made by CL 232298 to
reduce timer latency. On multiprocessor Plan 9 machines, it triggers
memory faults often enough that the builder test suite never completes
successfully. See issue #42303 for discussion. As shown by the benchmark
result below, worst case latency on plan9_arm is very bad even with the
wakep call in place - in the tickers-per-P=1 case, a 3ms timer is 270ms late.
Skipping the wakep call and running the benchmark again shows some cases
worse, some better. The performance cost doesn't seem excessive for this
temporary workaround which makes the plan9_arm builders usable again.

With wakep call:

cpu% go test -bench Latency time
goos: plan9
goarch: arm
pkg: time
BenchmarkParallelTimerLatency-4           100   10985859 avg-late-ns   18630963 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=1-4                195  270294688 avg-late-ns  542057670 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=2-4                234  182452000 avg-late-ns  423933688 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=3-4                280  193003004 avg-late-ns  408034405 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=4-4                282  132819086 avg-late-ns  313624570 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=5-4                339   71152187 avg-late-ns  189014519 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=6-4                315   26860484 avg-late-ns  101759844 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=7-4                357   19106739 avg-late-ns   59435620 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=8-4                376    7246933 avg-late-ns   38888461 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=9-4                267   40476892 avg-late-ns  205851926 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=10-4               294   87836303 avg-late-ns  252059695 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=2ms/tickers-per-P=1-4                  379    4127144 avg-late-ns   10494927 max-late-ns

Without wakep call:

BenchmarkParallelTimerLatency-4            61   10775151 avg-late-ns   18668517 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=1-4                199  299587535 avg-late-ns  597182307 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=2-4                272  184561831 avg-late-ns  449739837 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=3-4                235  154983257 avg-late-ns  370940553 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=4-4                290  150034689 avg-late-ns  332399843 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=5-4                298   47540764 avg-late-ns  133709031 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=6-4                350   20379394 avg-late-ns   81742809 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=7-4                363   14403223 avg-late-ns   98901212 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=8-4                375   12293090 avg-late-ns   50266552 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=9-4                336   40628820 avg-late-ns  150946099 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=300µs/tickers-per-P=10-4               289   88265539 avg-late-ns  280770418 max-late-ns
BenchmarkStaggeredTickerLatency/work-dur=2ms/tickers-per-P=1-4                  375    8364937 avg-late-ns   22598421 max-late-ns

Fixes #42303

Change-Id: I70c63cb2a2bad46950a7cd9dfc7bb32943710d32
Reviewed-on: https://go-review.googlesource.com/c/go/+/275672
Reviewed-by: David du Colombier <0intro@gmail.com>
Trust: Michael Pratt <mpratt@google.com>

3 years agotest: skip issue11656.go on mips/mips64/ppc64
Ian Lance Taylor [Sat, 19 Dec 2020 21:46:49 +0000 (13:46 -0800)]
test: skip issue11656.go on mips/mips64/ppc64

For #11656
For #43283

Change-Id: I1fcf2b24800f421e36201af43130b487abe605b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/279312
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
3 years agocmd/compile: recognize reassignments involving receives
Matthew Dempsky [Sun, 20 Dec 2020 09:15:46 +0000 (01:15 -0800)]
cmd/compile: recognize reassignments involving receives

Previously, reassigned was failing to detect reassignments due to
channel receives in select statements (OSELRECV, OSELRECV2), or due to
standalone 2-value receive assignments (OAS2RECV). This was reported
as a devirtualization panic, but could have caused mis-inlining as
well.

Fixes #43292.

Change-Id: Ic8079c20c0587aeacff9596697fdeba80a697b12
Reviewed-on: https://go-review.googlesource.com/c/go/+/279352
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>

3 years agotest: for issue11656 try to execute trap, not call it
Ian Lance Taylor [Wed, 16 Dec 2020 04:24:33 +0000 (20:24 -0800)]
test: for issue11656 try to execute trap, not call it

The issue11656 code was using the trap instruction as a PC value,
but it is intended to call a PC value that contains the trap instruction.

It doesn't matter too much as in practice the address is not
executable anyhow. But may as well have the code act the way it
is documented to act.

Also, don't run the test with gccgo/GoLLVM, as it can't work.
The illegal instruction will have no unwind data, so the unwinder
won't be able to get past it. In other words, gccgo/GoLLVM suffer
from the exact problem that the issue describes, but it seems insoluble.

For golang/go#11656

Change-Id: Ib2e50ffc91d215fd50e78f742fafe476c92d704e
Reviewed-on: https://go-review.googlesource.com/c/go/+/278473
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agotest: permit "exponent too large" error
Ian Lance Taylor [Fri, 18 Dec 2020 21:54:27 +0000 (13:54 -0800)]
test: permit "exponent too large" error

The language spec only requires a signed binary exponent of 16 bits
for floating point constants. Permit a "exponent too large" error for
larger exponents.

Don't run test 11326b with gccgo, as it requires successful compilation
of floating point constants with exponents that don't fit in 16 bits.

Change-Id: I98688160c76864aba525a151a14aaaf86bc36a6f
Reviewed-on: https://go-review.googlesource.com/c/go/+/279252
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
3 years agogo/build: make TestDependencies work again
Ian Lance Taylor [Thu, 17 Dec 2020 22:59:45 +0000 (14:59 -0800)]
go/build: make TestDependencies work again

CL 243940 accidentally broke TestDependencies such that it always passed.
Make it work again, and add a test so that it won't break in the same way.

This revealed that the new embed package was missing from TestDepencies,
so add it.

Fixes #43249

Change-Id: I02b3e38dd35ad88880c4344d46de13b7639aa4c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/279073
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
3 years agoos: remove dependency on strings package
Ian Lance Taylor [Thu, 17 Dec 2020 22:57:20 +0000 (14:57 -0800)]
os: remove dependency on strings package

Historically the os package has not imported the strings package.
That was enforced by go/build.TestDependencies, but that test
was accidentally broken (#43249). A dependency of os on strings
was accidentally added by CL 266364; remove it.

For #42026
For #43249

Change-Id: If932308f30561fdcc5c608d7563e849c0d2870d8
Reviewed-on: https://go-review.googlesource.com/c/go/+/279072
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>
3 years agoos/signal: fix flaky tests for NotifyContext.
Henrique Vicente [Mon, 16 Nov 2020 02:09:31 +0000 (03:09 +0100)]
os/signal: fix flaky tests for NotifyContext.

Test failures started to happen sporadically on some builds after the introduction of NotifyContext.
To make these tests more robust and avoid the risk of crosstalk we run them in a separate process.

Fixes #41561.

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

3 years agocmd/link: avoid use of -T when linking with lld
Than McIntosh [Mon, 14 Dec 2020 18:03:06 +0000 (13:03 -0500)]
cmd/link: avoid use of -T when linking with lld

When doing external linking on Windows, auto-detect the linker flavor
(bfd vs gold vs lld) and when linking with "lld", avoid the use of
"-T" (linker script), since this option is not supported by lld.
[Note: the Go linker currently employs -T to ensure proper placement
of the .debug_gdb_scripts section, to work around issues in older
versions of binutils; LLD recognizes this section and does place it
properly].

Updates #39326.

Change-Id: I3ea79cdceef2316bf86eccdb60188ac3655264ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/278932
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agotest: recognize and use gc build tag
Ian Lance Taylor [Thu, 17 Dec 2020 22:03:07 +0000 (14:03 -0800)]
test: recognize and use gc build tag

Change the run.go driver to recognize the "gc" build tag.

Change existing tests to use the "gc" build tag if they use some
feature that seems specific to the gc compiler, such as passing specific
options to or expecting specific behavior from "go tool compile".
Change tests to use the "!gccgo" build tag if they use "go build" or
"go run", as while those might work with compilers other than gc, they
won't work with the way that gccgo runs its testsuite (which happens
independently of the go command).

For #43252

Change-Id: I666e04b6d7255a77dfc256ee304094e3a6bb15ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/279052
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agoapi/go1.16: remove crypto/tls APIs that are moved to Go 1.17
Dmitri Shuralyov [Thu, 17 Dec 2020 20:17:14 +0000 (15:17 -0500)]
api/go1.16: remove crypto/tls APIs that are moved to Go 1.17

CL 269697 was created before CL 276454 and submitted after,
so the api/go1.16.txt file needs to be updated accordingly
to fix the build.

Updates #32406.

Change-Id: I6bf79cc981be504e0baefa82982814aaee4434dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/278992
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Katie Hockman <katie@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
3 years agocrypto/tls: revert "add HandshakeContext method to Conn"
Johan Brandhorst [Thu, 12 Nov 2020 20:34:51 +0000 (20:34 +0000)]
crypto/tls: revert "add HandshakeContext method to Conn"

This reverts CL 246338.

Reason for revert: waiting for 1.17 release cycle

Updates #32406

Change-Id: I074379039041e086c62271d689b4b7f442281663
Reviewed-on: https://go-review.googlesource.com/c/go/+/269697
Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
Trust: Katie Hockman <katie@golang.org>
Trust: Roland Shoemaker <roland@golang.org>

3 years agoapi: promote next to go1.16 go1.16beta1
Dmitri Shuralyov [Wed, 9 Dec 2020 03:54:44 +0000 (22:54 -0500)]
api: promote next to go1.16

Change-Id: Id7d242ddd4b80a763787513d0a658dd7aea9db7d
Reviewed-on: https://go-review.googlesource.com/c/go/+/276454
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
3 years agohtml/template: avoid race when escaping updates template
Ian Lance Taylor [Thu, 3 Dec 2020 03:18:46 +0000 (19:18 -0800)]
html/template: avoid race when escaping updates template

Fixes #39807

Change-Id: Icf384f800e2541bc753507daa3a9bc7e5d1c3f79
Reviewed-on: https://go-review.googlesource.com/c/go/+/274450
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Roberto Clapis <roberto@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
3 years agogo/types: report error for invalid (but empty) expr switch
Rob Findley [Wed, 16 Dec 2020 22:19:44 +0000 (17:19 -0500)]
go/types: report error for invalid (but empty) expr switch

This is a port of CL 278132 from the dev.typeparams branch. A notable
addition is a new error code, since no existing codes made sense and we
have an analogous code for type switches.

Fixes #43110

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

3 years agocmd/link: handle large relocation addend on darwin/arm64
Cherry Zhang [Mon, 14 Dec 2020 23:52:13 +0000 (18:52 -0500)]
cmd/link: handle large relocation addend on darwin/arm64

Mach-O relocation addend is signed 24-bit. When external linking,
if the addend is larger, we cannot put it directly into a Mach-O
relocation. This CL handles large addend by creating "label"
symbols at sym+0x800000, sym+(0x800000*2), etc., and emitting
Mach-O relocations that target the label symbols with a smaller
addend. The label symbols are generated late (similar to what
we do for RISC-V64).

One complexity comes from handling of carrier symbols, which does
not track its size or its inner symbols. But relocations can
target them. We track them in a side table (similar to what we
do for XCOFF, xcoffUpdateOuterSize).

Fixes #42738.

Change-Id: I8c53ab2397f8b88870d26f00e9026285e5ff5584
Reviewed-on: https://go-review.googlesource.com/c/go/+/278332
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
3 years agocmd/link: pass arch-specific flags to external linker when testing supported flag
Cherry Zhang [Tue, 15 Dec 2020 23:31:21 +0000 (18:31 -0500)]
cmd/link: pass arch-specific flags to external linker when testing supported flag

When testing if a flag (e.g. "-no-pie") is supported by the
external linker, pass arch-specific flags (like "-marm").

In particular, on the ARM builder, if CGO_LDFLAGS=-march=armv6
is set, the C toolchain fails to build if -marm is not passed.

# cc -march=armv6 1.c
1.c: In function 'main':
1.c:3:1: sorry, unimplemented: Thumb-1 hard-float VFP ABI
 int main() {
 ^~~

This makes the Go linker think "-no-pie" is not supported when it
actually is.

Passing -marm makes it work.

Fixes #43202.

Change-Id: I4e8b71f08818993cbbcb2494b310c68d812d6b50
Reviewed-on: https://go-review.googlesource.com/c/go/+/278592
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
3 years agocmd/internal/goobj: fix buglet in object file reader
Than McIntosh [Tue, 15 Dec 2020 20:54:25 +0000 (15:54 -0500)]
cmd/internal/goobj: fix buglet in object file reader

The code in the new (introduced in 1.15) Go object file reader was
casting a pointer-mmaped-memory into a large array prior to performing
a read of the relocations section:

return (*[1<<20]Reloc)(unsafe.Pointer(&r.b[off]))[:n:n]

For very large object files, this artificial array isn't large enough
(that is, there are more than 1048576 relocs to read), so update the
code to use a larger artifical array size.

Fixes #41621.

Change-Id: Ic047c8aef4f8a3839f2e7e3594bce652ebd6bd5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/278492
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Trust: Than McIntosh <thanm@google.com>

3 years agodoc/go1.16: add link to reflect.StructTag
Tobias Klauser [Tue, 15 Dec 2020 16:48:38 +0000 (17:48 +0100)]
doc/go1.16: add link to reflect.StructTag

For #40700.

Change-Id: I67dd55b435304e428929c9a54b8881f9b78efdfb
Reviewed-on: https://go-review.googlesource.com/c/go/+/278392
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agonet: close connection in localServer teardown
Meng Zhuo [Sat, 28 Nov 2020 10:09:21 +0000 (18:09 +0800)]
net: close connection in localServer teardown

The transponder sets up a deferred close on accepted connections which
is fine after the client reads all data. However there are no mutexes
nor channels to block the transponder from closing. If the scheduler
runs close before the client read, it will cause an EOF failure.

Fixes #42720

Change-Id: Ic21b476c5efc9265a80a2c6f8484efdb5af66405
Reviewed-on: https://go-review.googlesource.com/c/go/+/273672
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Meng Zhuo <mzh@golangcn.org>
Reviewed-by: Damien Neil <dneil@google.com>
3 years agocmd/link: ignore SEH marking on PE objects
Jason A. Donenfeld [Sun, 8 Nov 2020 02:20:36 +0000 (03:20 +0100)]
cmd/link: ignore SEH marking on PE objects

Microsoft's linker looks at whether all input objects have an empty
section called @feat.00. If all of them do, then it enables SEH;
otherwise it doesn't enable that feature. So, since around the Windows
XP SP2 era, most tools that make PE objects just tack on that section,
so that it won't gimp Microsoft's linker logic. Go doesn't support SEH,
so in theory, none of this really matters to us. But actually, if the
linker tries to ingest an object with @feat.00 -- which are produced by
LLVM's resource compiler, for example -- it chokes because of the
IMAGE_SYM_ABSOLUTE section that it doesn't know how to deal with. Since
@feat.00 is just a marking anyway, skip IMAGE_SYM_ABSOLUTE sections that
are called @feat.00.

Change-Id: I1d7bfcf6001186c53e2c487c5ac251ca65efefee
Reviewed-on: https://go-review.googlesource.com/c/go/+/268239
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>

3 years agotest: update for gofrontend error message changes
Ian Lance Taylor [Tue, 15 Dec 2020 21:15:07 +0000 (13:15 -0800)]
test: update for gofrontend error message changes

fixedbugs/bug195.go:9:20: error: interface contains embedded non-interface
fixedbugs/bug195.go:12:20: error: interface contains embedded non-interface
fixedbugs/bug195.go:15:22: error: interface contains embedded non-interface
fixedbugs/bug195.go:18:9: error: invalid recursive interface
fixedbugs/bug195.go:26:9: error: invalid recursive interface

fixedbugs/bug251.go:15:9: error: invalid recursive interface

fixedbugs/issue23823.go:15:9: error: invalid recursive interface

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

3 years agodoc/go1.15: mention 1.15.3 cgo restriction on empty structs
Ian Lance Taylor [Sat, 12 Dec 2020 03:10:00 +0000 (19:10 -0800)]
doc/go1.15: mention 1.15.3 cgo restriction on empty structs

For #40954

Change-Id: I6a30aed31a16e820817f4ca5c7f591222e922946
Reviewed-on: https://go-review.googlesource.com/c/go/+/277432
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
3 years agotest: match gofrontend error messages
Ian Lance Taylor [Tue, 15 Dec 2020 06:27:32 +0000 (22:27 -0800)]
test: match gofrontend error messages

fixedbugs/issue11614.go:14:9: error: interface contains embedded non-interface
fixedbugs/issue11614.go:22:20: error: interface contains embedded non-interface

Change-Id: Ie9875916697833f5fa28ab890218851a741120ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/278175
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agotest: only require issue11674 errors with gc compiler
Ian Lance Taylor [Tue, 15 Dec 2020 06:03:29 +0000 (22:03 -0800)]
test: only require issue11674 errors with gc compiler

The gofrontend code sees that the denominator is not zero,
so it computes the values. Dividing zero by a non-zero value
produces zero. The language spec doesn't require any of these
cases to report an error, so make the errors compiler-specific.

Change-Id: I5ed759a3121e38b937744d32250adcbdf2c4d3c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/278117
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
3 years agotest: remove bug429 (duplicates runtime.TestSimpleDeadlock)
Ian Lance Taylor [Tue, 15 Dec 2020 05:20:36 +0000 (21:20 -0800)]
test: remove bug429 (duplicates runtime.TestSimpleDeadlock)

The bug429 tests is an exact duplicate of TestSimpleDeadlock in the
runtime package. The runtime package is the right place for this test,
and the version in the runtime package will run faster as the build
step is combined with other runtime package tests.

Change-Id: I6538d24e6df8e8c5e3e399d3ff37d68f3e52be56
Reviewed-on: https://go-review.googlesource.com/c/go/+/278173
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agotest: adjust issue11371 to fit in required precision
Ian Lance Taylor [Tue, 15 Dec 2020 05:56:25 +0000 (21:56 -0800)]
test: adjust issue11371 to fit in required precision

The language spec only requires that floating point values be
represented with 256 bits, which is about 1e75. The issue11371 test
was assuming that the compiler could represent 1e100. Adjusting the
test so that it only assumes 256 bits of precision still keeps the
test valid, and permits it to pass when using the gofrontend.

Change-Id: I9d1006e9adc9438277f4b8002488c912e5d61cc1
Reviewed-on: https://go-review.googlesource.com/c/go/+/278116
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agotest: only check for issue11362 error with gc
Ian Lance Taylor [Tue, 15 Dec 2020 05:43:50 +0000 (21:43 -0800)]
test: only check for issue11362 error with gc

With the gc compiler the import path implies the package path,
so keeping a canonical path is important.  With the gofrontend
this is not the case, so we don't need to report this as a bug.

Change-Id: I245e34f9b66383bd17e79438d4b002a3e20aa994
Reviewed-on: https://go-review.googlesource.com/c/go/+/278115
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agotest: import file name for issue19028
Ian Lance Taylor [Tue, 15 Dec 2020 03:18:20 +0000 (19:18 -0800)]
test: import file name for issue19028

The pattern in NNN.dir directories is that if we have a.go,
the other files import "./a". For gc it happens to work to use a path,
but not for gofrontend. Better to be consistent.

Change-Id: I2e023cbf6bd115f9fb77427b097b0ff9b9992f17
Reviewed-on: https://go-review.googlesource.com/c/go/+/278113
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agodoc/go1.16: fix path, path/filepath release notes
Tobias Klauser [Tue, 15 Dec 2020 09:41:54 +0000 (10:41 +0100)]
doc/go1.16: fix path, path/filepath release notes

The path package doesn't have a Glob function. Adjust the release notes
re. CL 264397 accordingly.

Also add links to the documentation of all mentioned functions.

For #40700.

Change-Id: Ibf3e0530fa6fab36a3f6fbc664f0800869ce9ec7
Reviewed-on: https://go-review.googlesource.com/c/go/+/278213
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
3 years agodoc/go1.16: fix formatting in net, net/http and net/http/httputil sections
Tobias Klauser [Tue, 15 Dec 2020 09:36:10 +0000 (10:36 +0100)]
doc/go1.16: fix formatting in net, net/http and net/http/httputil sections

For #40700.

Change-Id: I83d9ef9f79d59a0165a47ccc938fc2bf40e90703
Reviewed-on: https://go-review.googlesource.com/c/go/+/278212
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
3 years agotext/template: error on range over send channel
Meng Zhuo [Thu, 10 Dec 2020 01:52:52 +0000 (09:52 +0800)]
text/template: error on range over send channel

template range require channel contains RecvDir
if recv on send only channel will raise an panic.

Fixes #43065

Change-Id: Ie0ea70ce60e074bf8c9f2378e07ef1d4c41dc38f
Reviewed-on: https://go-review.googlesource.com/c/go/+/276532
Trust: Meng Zhuo <mzh@golangcn.org>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
3 years agotest: recognize gofrontend error messages
Ian Lance Taylor [Mon, 14 Dec 2020 21:26:35 +0000 (13:26 -0800)]
test: recognize gofrontend error messages

fixedbugs/issue26416.go:24:16: error: unknown field ‘t1f1’ in ‘t2’
fixedbugs/issue26416.go:25:16: error: unknown field ‘t1f2’ in ‘t3’
fixedbugs/issue26416.go:26:16: error: unknown field ‘t2f1’ in ‘t3’

fixedbugs/issue26616.go:15:9: error: single variable set to multiple-value function call
fixedbugs/issue26616.go:9:5: error: incompatible type in initialization (multiple-value function call in single-value context)
fixedbugs/issue26616.go:12:13: error: incompatible type in initialization (multiple-value function call in single-value context)
fixedbugs/issue26616.go:13:13: error: incompatible type in initialization (multiple-value function call in single-value context)
fixedbugs/issue26616.go:15:9: error: incompatible type in initialization (multiple-value function call in single-value context)
fixedbugs/issue26616.go:14:11: error: incompatible types in assignment (multiple-value function call in single-value context)

fixedbugs/issue26855.go:23:12: error: incompatible type for field 1 in struct construction
fixedbugs/issue26855.go:27:12: error: incompatible type for field 1 in struct construction

fixedbugs/issue25958.go:14:18: error: expected ‘<-’ or ‘=’
fixedbugs/issue25958.go:15:35: error: expected ‘<-’ or ‘=’

fixedbugs/issue28079b.go:13:9: error: array bound is not constant
fixedbugs/issue28079b.go:16:22: error: invalid context-determined non-integer type for left operand of shift

fixedbugs/issue28079c.go:14:22: error: invalid context-determined non-integer type for left operand of shift

fixedbugs/issue28450.go:9:19: error: ‘...’ only permits one name
fixedbugs/issue28450.go:10:18: error: ‘...’ must be last parameter
fixedbugs/issue28450.go:11:16: error: ‘...’ must be last parameter
fixedbugs/issue28450.go:11:24: error: ‘...’ must be last parameter
fixedbugs/issue28450.go:13:25: error: ‘...’ must be last parameter
fixedbugs/issue28450.go:15:19: error: ‘...’ must be last parameter
fixedbugs/issue28450.go:16:21: error: ‘...’ must be last parameter
fixedbugs/issue28450.go:16:31: error: ‘...’ must be last parameter

fixedbugs/issue28268.go:20:1: error: method ‘E’ redeclares struct field name
fixedbugs/issue28268.go:19:1: error: method ‘b’ redeclares struct field name

fixedbugs/issue27356.go:14:14: error: expected function
fixedbugs/issue27356.go:18:9: error: expected function

fixedbugs/issue29855.go:13:11: error: unknown field ‘Name’ in ‘T’

fixedbugs/issue27938.go:14:15: error: expected package
fixedbugs/issue27938.go:18:13: error: expected package
fixedbugs/issue27938.go:22:13: error: expected package
fixedbugs/issue27938.go:22:9: error: expected signature or type name

fixedbugs/issue29870b.go:13:9: error: ‘x’ declared but not used

fixedbugs/issue30085.go:10:18: error: wrong number of initializations
fixedbugs/issue30085.go:11:21: error: wrong number of initializations

fixedbugs/issue30087.go:10:18: error: wrong number of initializations
fixedbugs/issue30087.go:11:11: error: number of variables does not match number of values
fixedbugs/issue30087.go:12:9: error: wrong number of initializations
fixedbugs/issue30087.go:13:9: error: wrong number of initializations

fixedbugs/issue28926.go:16:14: error: use of undefined type ‘G’
fixedbugs/issue28926.go:18:14: error: use of undefined type ‘E’
fixedbugs/issue28926.go:22:24: error: use of undefined type ‘T’

fixedbugs/issue30722.go:13:13: error: invalid numeric literal
fixedbugs/issue30722.go:14:13: error: invalid numeric literal
fixedbugs/issue30722.go:15:13: error: invalid numeric literal

fixedbugs/issue33308.go:12:19: error: invalid context-determined non-integer type for left operand of shift

fixedbugs/issue33386.go:16:9: error: expected operand
fixedbugs/issue33386.go:22:9: error: expected operand
fixedbugs/issue33386.go:26:17: error: expected operand
fixedbugs/issue33386.go:27:18: error: expected operand
fixedbugs/issue33386.go:28:29: error: expected operand
fixedbugs/issue33386.go:15:17: error: reference to undefined name ‘send’
fixedbugs/issue33386.go:27:13: error: reference to undefined name ‘a’
fixedbugs/issue33386.go:21:19: error: value computed is not used

fixedbugs/issue33460.go:34:10: error: duplicate key in map literal
fixedbugs/issue33460.go:21:9: error: duplicate case in switch
fixedbugs/issue33460.go:24:9: error: duplicate case in switch
fixedbugs/issue33460.go:25:9: error: duplicate case in switch

fixedbugs/issue32723.go:12:14: error: invalid comparison of non-ordered type
fixedbugs/issue32723.go:13:13: error: invalid comparison of non-ordered type
fixedbugs/issue32723.go:16:16: error: invalid comparison of non-ordered type
fixedbugs/issue32723.go:17:16: error: invalid comparison of non-ordered type
fixedbugs/issue32723.go:18:15: error: invalid comparison of non-ordered type
fixedbugs/issue32723.go:21:15: error: invalid comparison of non-ordered type

fixedbugs/issue35291.go:13:9: error: duplicate value for index 1

fixedbugs/issue38745.go:12:12: error: reference to undefined field or method ‘M’
fixedbugs/issue38745.go:13:16: error: reference to undefined field or method ‘M’
fixedbugs/issue38745.go:17:19: error: reference to undefined field or method ‘M’
fixedbugs/issue38745.go:17:9: error: not enough arguments to return

fixedbugs/issue41500.go:16:22: error: incompatible types in binary expression
fixedbugs/issue41500.go:17:26: error: incompatible types in binary expression
fixedbugs/issue41500.go:18:22: error: incompatible types in binary expression
fixedbugs/issue41500.go:19:26: error: incompatible types in binary expression

fixedbugs/issue41575.go:23:6: error: invalid recursive type
fixedbugs/issue41575.go:9:6: error: invalid recursive type ‘T1’
fixedbugs/issue41575.go:13:6: error: invalid recursive type ‘T2’
fixedbugs/issue41575.go:17:6: error: invalid recursive type ‘a’
fixedbugs/issue41575.go:18:6: error: invalid recursive type ‘b’
fixedbugs/issue41575.go:19:6: error: invalid recursive type ‘c’
fixedbugs/issue41575.go:25:6: error: invalid recursive type ‘g’
fixedbugs/issue41575.go:32:6: error: invalid recursive type ‘x’
fixedbugs/issue41575.go:33:6: error: invalid recursive type ‘y’

fixedbugs/issue4215.go:10:9: error: not enough arguments to return
fixedbugs/issue4215.go:14:9: error: return with value in function with no return type
fixedbugs/issue4215.go:19:17: error: not enough arguments to return
fixedbugs/issue4215.go:21:9: error: not enough arguments to return
fixedbugs/issue4215.go:27:17: error: not enough arguments to return
fixedbugs/issue4215.go:29:17: error: too many values in return statement
fixedbugs/issue4215.go:31:17: error: not enough arguments to return
fixedbugs/issue4215.go:43:17: error: not enough arguments to return
fixedbugs/issue4215.go:46:17: error: not enough arguments to return
fixedbugs/issue4215.go:48:9: error: too many values in return statement
fixedbugs/issue4215.go:52:9: error: too many values in return statement

fixedbugs/issue41247.go:10:16: error: incompatible type for return value 1

fixedbugs/issue41440.go:13:9: error: too many arguments

fixedbugs/issue6772.go:10:16: error: ‘a’ repeated on left side of :=
fixedbugs/issue6772.go:17:16: error: ‘a’ repeated on left side of :=

fixedbugs/issue6402.go:12:16: error: incompatible type for return value 1

fixedbugs/issue6403.go:13:23: error: reference to undefined identifier ‘syscall.X’
fixedbugs/issue6403.go:14:15: error: reference to undefined name ‘voidpkg’

fixedbugs/issue7746.go:24:20: error: constant multiplication overflow

fixedbugs/issue7760.go:15:7: error: invalid constant type
fixedbugs/issue7760.go:16:7: error: invalid constant type
fixedbugs/issue7760.go:18:7: error: invalid constant type
fixedbugs/issue7760.go:19:7: error: invalid constant type
fixedbugs/issue7760.go:21:11: error: expression is not constant
fixedbugs/issue7760.go:22:11: error: expression is not constant
fixedbugs/issue7760.go:24:7: error: invalid constant type
fixedbugs/issue7760.go:25:7: error: invalid constant type

fixedbugs/issue7129.go:18:11: error: argument 1 has incompatible type (cannot use type bool as type int)
fixedbugs/issue7129.go:19:11: error: argument 1 has incompatible type (cannot use type bool as type int)
fixedbugs/issue7129.go:20:11: error: argument 1 has incompatible type (cannot use type bool as type int)
fixedbugs/issue7129.go:20:17: error: argument 2 has incompatible type (cannot use type bool as type int)

fixedbugs/issue7150.go:12:20: error: index expression is negative
fixedbugs/issue7150.go:13:13: error: some element keys in composite literal are out of range
fixedbugs/issue7150.go:14:13: error: some element keys in composite literal are out of range
fixedbugs/issue7150.go:15:13: error: some element keys in composite literal are out of range
fixedbugs/issue7150.go:16:13: error: some element keys in composite literal are out of range

fixedbugs/issue7675.go:16:11: error: argument 1 has incompatible type (cannot use type int as type string)
fixedbugs/issue7675.go:16:24: error: argument 3 has incompatible type (cannot use type string as type float64)
fixedbugs/issue7675.go:16:9: error: not enough arguments
fixedbugs/issue7675.go:16:14: error: floating-point constant truncated to integer
fixedbugs/issue7675.go:18:11: error: argument 1 has incompatible type (cannot use type int as type string)
fixedbugs/issue7675.go:18:24: error: argument 3 has incompatible type (cannot use type string as type float64)
fixedbugs/issue7675.go:18:28: error: argument 4 has incompatible type (cannot use type int as type string)
fixedbugs/issue7675.go:18:9: error: too many arguments
fixedbugs/issue7675.go:18:14: error: floating-point constant truncated to integer
fixedbugs/issue7675.go:19:11: error: argument 1 has incompatible type (cannot use type int as type string)
fixedbugs/issue7675.go:19:9: error: not enough arguments
fixedbugs/issue7675.go:19:14: error: floating-point constant truncated to integer
fixedbugs/issue7675.go:21:11: error: argument 1 has incompatible type (cannot use type int as type string)
fixedbugs/issue7675.go:21:19: error: argument 3 has incompatible type
fixedbugs/issue7675.go:21:14: error: floating-point constant truncated to integer
fixedbugs/issue7675.go:23:14: error: floating-point constant truncated to integer

fixedbugs/issue7153.go:11:15: error: reference to undefined name ‘a’
fixedbugs/issue7153.go:11:18: error: incompatible type for element 1 in composite literal
fixedbugs/issue7153.go:11:24: error: incompatible type for element 2 in composite literal

fixedbugs/issue7310.go:12:13: error: left argument must be a slice
fixedbugs/issue7310.go:13:13: error: second argument must be slice or string
fixedbugs/issue7310.go:14:15: error: incompatible types in binary expression

fixedbugs/issue6964.go:10:13: error: invalid type conversion (cannot use type complex128 as type string)

fixedbugs/issue7538a.go:14:9: error: reference to undefined label ‘_’

fixedbugs/issue8311.go:14:9: error: increment or decrement of non-numeric type

fixedbugs/issue8507.go:12:6: error: invalid recursive type ‘T’

fixedbugs/issue9521.go:16:20: error: argument 2 has incompatible type
fixedbugs/issue9521.go:17:20: error: argument 2 has incompatible type (cannot use type float64 as type int)

fixedbugs/issue8385.go:30:19: error: argument 1 has incompatible type (type has no methods)
fixedbugs/issue8385.go:30:14: error: not enough arguments
fixedbugs/issue8385.go:35:9: error: not enough arguments
fixedbugs/issue8385.go:36:9: error: not enough arguments
fixedbugs/issue8385.go:37:10: error: not enough arguments
fixedbugs/issue8385.go:38:10: error: not enough arguments
fixedbugs/issue8385.go:39:10: error: not enough arguments
fixedbugs/issue8385.go:40:10: error: not enough arguments
fixedbugs/issue8385.go:41:13: error: not enough arguments

fixedbugs/issue8438.go:13:23: error: incompatible type for element 1 in composite literal
fixedbugs/issue8438.go:14:22: error: incompatible type for element 1 in composite literal
fixedbugs/issue8438.go:15:23: error: incompatible type for element 1 in composite literal

fixedbugs/issue8440.go:10:9: error: reference to undefined name ‘n’

Change-Id: I5707aec7d3c9178c4f4d794d4827fc907b52efb3
Reviewed-on: https://go-review.googlesource.com/c/go/+/278032
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 Zhang <cherryyz@google.com>
3 years agocmd/link: do not mark resource section as writable
Jason A. Donenfeld [Sun, 8 Nov 2020 10:11:27 +0000 (11:11 +0100)]
cmd/link: do not mark resource section as writable

Resources are immutable, and all other linkers set this section to be
read-only and not read-write. Fix this oversight by removing the writable
flag.

Change-Id: Ib441bde6620be2000f1685df1ea7bfaebdbe7860
Reviewed-on: https://go-review.googlesource.com/c/go/+/268258
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>

3 years agocmd/link: deal with ADDR32NB relocations the same way as ADDR32 on arm
Jason A. Donenfeld [Sun, 8 Nov 2020 02:09:42 +0000 (03:09 +0100)]
cmd/link: deal with ADDR32NB relocations the same way as ADDR32 on arm

As far as I can tell, the addend is the same for both of these, and in
this context we don't really care about setting or unsetting the thumb
selection bit, so just treat these the same way.

Change-Id: I3756c027239f77778c32b317733df9ac92272580
Reviewed-on: https://go-review.googlesource.com/c/go/+/268238
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>

3 years agocmd/link: recognize arm header of PE objects
Jason A. Donenfeld [Sun, 8 Nov 2020 01:48:09 +0000 (02:48 +0100)]
cmd/link: recognize arm header of PE objects

The linker recognizes headers for 386 and amd64 PE objects, but not arm
objects. This is easily overlooked, since its the same as the 386 header
value, except the two nibbles of the first word are swapped. This commit
simply adds the check for this. Without it, .syso objects are rejected,
which means Windows binaries can't have resources built into them. At
the same time, we add comments to better indicate which condition
applies to which arch.

Change-Id: I210411d978504c1a9540e23abc5a180e24f159ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/268237
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>

3 years agonet/http/pprof: don't treat os.Args as format string in Cmdline handler
Brad Fitzpatrick [Mon, 14 Dec 2020 20:09:17 +0000 (12:09 -0800)]
net/http/pprof: don't treat os.Args as format string in Cmdline handler

Found by @josharian running staticcheck against a fork of this code
elsewhere.

Change-Id: Ica8bae5df71adde1a71e541dd55b0b81b97b3baf
Reviewed-on: https://go-review.googlesource.com/c/go/+/277992
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Josh Bleecher Snyder <josharian@gmail.com>

3 years agogo/types: report invalid ... in conversions
Rob Findley [Fri, 11 Dec 2020 21:24:26 +0000 (16:24 -0500)]
go/types: report invalid ... in conversions

This is a port of CL 277072 from the dev.typeparams branch.

Fixes #43124

Change-Id: I1424c396dc1ea984ec85b8f31a4d43353bf7e4fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/277352
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
3 years agoio/fs: fix package reference in FS godoc
Tobias Klauser [Mon, 14 Dec 2020 10:14:05 +0000 (11:14 +0100)]
io/fs: fix package reference in FS godoc

Reported by Ben on golang-dev
https://groups.google.com/g/golang-dev/c/gsoj5Vv15j0/m/kZxzYUdnAQAJ

Change-Id: Ic2c9600b831592ad54036b816138760b7fbb737a
Reviewed-on: https://go-review.googlesource.com/c/go/+/277377
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
3 years agodoc/go1.16: add missing <code> tag
Tobias Klauser [Mon, 14 Dec 2020 10:25:04 +0000 (11:25 +0100)]
doc/go1.16: add missing <code> tag

For #40700.

Change-Id: I616429f82a44cea32701ed0af6e42ed6c71ee097
Reviewed-on: https://go-review.googlesource.com/c/go/+/277378
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
3 years agomath/big: add test for recursive division panic
Katie Hockman [Tue, 24 Nov 2020 20:37:25 +0000 (15:37 -0500)]
math/big: add test for recursive division panic

The vulnerability that allowed this panic is
CVE-2020-28362 and has been fixed in a security
release, per #42552.

Change-Id: I774bcda2cc83cdd5a273d21c8d9f4b53fa17c88f
Reviewed-on: https://go-review.googlesource.com/c/go/+/277959
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Katie Hockman <katie@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
3 years agotest: make a race detector test robust to timing variations
Daniel S Fava [Wed, 9 Dec 2020 22:56:50 +0000 (23:56 +0100)]
test: make a race detector test robust to timing variations

The `external_cgo_thread` test in `runtime/race/output_test.go` was
producing intermittent failures.  The test was performing a sleep,
which may not be enough depending on how long it takes to setup the
callBack goroutine.

Added a synchronization to make sure callBack finishes before main ends.

Whether the increment to racy++ happens first in the callBack
or in main doesn't matter: the race detector should flag the race
regardless.  The output check was changed so that the test passes
regardless of which increment occurs first.

Fixes #43008

Change-Id: I325ec3dea52b3725e739fbf2bd7ae92875d2de10
Reviewed-on: https://go-review.googlesource.com/c/go/+/276752
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>

3 years agonet/http: attempt deadlock fix in TestDisableKeepAliveUpgrade
Anmol Sethi [Fri, 11 Dec 2020 23:01:12 +0000 (23:01 +0000)]
net/http: attempt deadlock fix in TestDisableKeepAliveUpgrade

1. The test now checks the response status code.
2. The transport has been changed to not set "Connection: Close" if
   DisableKeepAlive is set and the request is a HTTP/1.1 protocol
   upgrade.

Updates #43073

Change-Id: I9977a18b33b8747ef847a8d11bb7b4f2d8053b8c
GitHub-Last-Rev: f809cebb139df4f5560a8456973351c95a3dfa97
GitHub-Pull-Request: golang/go#43086
Reviewed-on: https://go-review.googlesource.com/c/go/+/276375
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Trust: Dmitri Shuralyov <dmitshur@golang.org>

3 years agodebug/dwarf: don't try to parse addr/rnglists header
Ian Lance Taylor [Fri, 11 Dec 2020 23:15:43 +0000 (15:15 -0800)]
debug/dwarf: don't try to parse addr/rnglists header

In an executable, the debug_addr and debug_rnglists sections are
assembled by concatenating the input sections, and each input section
has a header, and each header may have different attributes. So just
parsing the single header isn't right.  Parsing the header is not
necessary to handle offsets into these sections which is all we do.

Looking at the header is also problematic because GCC with
-gsplit-dwarf when using DWARF versions 2 through 4 emits a
.debug_addr section, but it has no header.  The header was only added
for DWARF 5. So we can't parse the header at all for that case, and we
can't even detect that case in general.

This CL also fixes SeekPC with addrx and strx formats, by not using
the wrong compilation unit to find the address or string base.
To make that work when parsing the compilation unit itself, we add
support for delay the resolution of those values until we know the base.

New test binaries built with

gcc -gdwarf-5 -no-pie debug/dwarf/testdata/line[12].c
(gcc (Debian 10.2.0-15) 10.2.0)

clang -gdwarf-5 -no-pie debug/dwarf/testdata/line[12].c
(clang version 9.0.1-14)

Change-Id: I66783e0eded629bf80c467767f781164d344a54d
Reviewed-on: https://go-review.googlesource.com/c/go/+/277233
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
3 years agotest: match gofrontend error messages
Ian Lance Taylor [Mon, 14 Dec 2020 06:48:02 +0000 (22:48 -0800)]
test: match gofrontend error messages

fixedbugs/issue20602.go:13:9: error: argument must have complex type
fixedbugs/issue20602.go:14:9: error: argument must have complex type

fixedbugs/issue19323.go:12:12: error: attempt to slice object that is not array, slice, or string
fixedbugs/issue19323.go:18:13: error: attempt to slice object that is not array, slice, or string

fixedbugs/issue20749.go:12:11: error: array index out of bounds
fixedbugs/issue20749.go:15:11: error: array index out of bounds

fixedbugs/issue20415.go:14:5: error: redefinition of ‘f’
fixedbugs/issue20415.go:12:5: note: previous definition of ‘f’ was here
fixedbugs/issue20415.go:25:5: error: redefinition of ‘g’
fixedbugs/issue20415.go:20:5: note: previous definition of ‘g’ was here
fixedbugs/issue20415.go:33:5: error: redefinition of ‘h’
fixedbugs/issue20415.go:31:5: note: previous definition of ‘h’ was here

fixedbugs/issue19977.go:12:21: error: reference to undefined name ‘a’

fixedbugs/issue20812.go:10:13: error: invalid type conversion (cannot use type string as type int)
fixedbugs/issue20812.go:11:13: error: invalid type conversion (cannot use type int as type bool)
fixedbugs/issue20812.go:12:13: error: invalid type conversion (cannot use type string as type bool)
fixedbugs/issue20812.go:13:13: error: invalid type conversion (cannot use type bool as type int)
fixedbugs/issue20812.go:14:13: error: invalid type conversion (cannot use type bool as type string)

fixedbugs/issue21256.go:9:5: error: redefinition of ‘main’

fixedbugs/issue20813.go:10:11: error: invalid left hand side of assignment

fixedbugs/issue20185.go:22:16: error: ‘t’ declared but not used
fixedbugs/issue20185.go:13:9: error: cannot type switch on non-interface value
fixedbugs/issue20185.go:22:9: error: cannot type switch on non-interface value

fixedbugs/issue20227.go:11:11: error: division by zero
fixedbugs/issue20227.go:12:12: error: division by zero
fixedbugs/issue20227.go:13:12: error: division by zero
fixedbugs/issue20227.go:15:11: error: division by zero
fixedbugs/issue20227.go:16:12: error: division by zero

fixedbugs/issue19880.go:14:13: error: invalid use of type

fixedbugs/issue23093.go:9:5: error: initialization expression for ‘f’ depends upon itself

fixedbugs/issue21979.go:29:13: error: integer constant overflow
fixedbugs/issue21979.go:39:13: error: complex constant truncated to floating-point
fixedbugs/issue21979.go:10:13: error: invalid type conversion (cannot use type string as type bool)
fixedbugs/issue21979.go:11:13: error: invalid type conversion (cannot use type int as type bool)
fixedbugs/issue21979.go:12:13: error: invalid type conversion (cannot use type float64 as type bool)
fixedbugs/issue21979.go:13:13: error: invalid type conversion (cannot use type complex128 as type bool)
fixedbugs/issue21979.go:15:13: error: invalid type conversion (cannot use type bool as type string)
fixedbugs/issue21979.go:17:13: error: invalid type conversion (cannot use type float64 as type string)
fixedbugs/issue21979.go:18:13: error: invalid type conversion (cannot use type complex128 as type string)
fixedbugs/issue21979.go:20:13: error: invalid type conversion (cannot use type string as type int)
fixedbugs/issue21979.go:21:13: error: invalid type conversion (cannot use type bool as type int)
fixedbugs/issue21979.go:27:13: error: invalid type conversion (cannot use type string as type uint)
fixedbugs/issue21979.go:28:13: error: invalid type conversion (cannot use type bool as type uint)
fixedbugs/issue21979.go:34:13: error: invalid type conversion (cannot use type string as type float64)
fixedbugs/issue21979.go:35:13: error: invalid type conversion (cannot use type bool as type float64)
fixedbugs/issue21979.go:41:13: error: invalid type conversion (cannot use type string as type complex128)
fixedbugs/issue21979.go:42:13: error: invalid type conversion (cannot use type bool as type complex128)

fixedbugs/issue21988.go:11:11: error: reference to undefined name ‘Wrong’

fixedbugs/issue22063.go:11:11: error: reference to undefined name ‘Wrong’

fixedbugs/issue22904.go:12:6: error: invalid recursive type ‘a’
fixedbugs/issue22904.go:13:6: error: invalid recursive type ‘b’

fixedbugs/issue22921.go:11:16: error: reference to undefined identifier ‘bytes.nonexist’
fixedbugs/issue22921.go:13:19: error: reference to undefined identifier ‘bytes.nonexist’
fixedbugs/issue22921.go:13:19: error: expected signature or type name
fixedbugs/issue22921.go:17:15: error: reference to undefined identifier ‘bytes.buffer’

fixedbugs/issue23823.go:15:9: error: invalid recursive interface
fixedbugs/issue23823.go:10:9: error: invalid recursive interface

fixedbugs/issue23732.go:24:13: error: too few expressions for struct
fixedbugs/issue23732.go:34:17: error: too many expressions for struct
fixedbugs/issue23732.go:37:13: error: too few expressions for struct
fixedbugs/issue23732.go:40:17: error: too many expressions for struct

fixedbugs/issue22794.go:16:14: error: reference to undefined field or method ‘floats’
fixedbugs/issue22794.go:18:19: error: unknown field ‘floats’ in ‘it’
fixedbugs/issue22794.go:19:17: error: unknown field ‘InneR’ in ‘it’
fixedbugs/issue22794.go:18:9: error: ‘i2’ declared but not used

fixedbugs/issue22822.go:15:17: error: expected function

fixedbugs/issue25727.go:12:10: error: reference to unexported field or method ‘doneChan’
fixedbugs/issue25727.go:13:10: error: reference to undefined field or method ‘DoneChan’
fixedbugs/issue25727.go:14:21: error: unknown field ‘tlsConfig’ in ‘http.Server’
fixedbugs/issue25727.go:15:21: error: unknown field ‘DoneChan’ in ‘http.Server’
fixedbugs/issue25727.go:21:14: error: unknown field ‘bAr’ in ‘foo’

Change-Id: I32ce0b7d80017b2367b8fb479a881632240d4161
Reviewed-on: https://go-review.googlesource.com/c/go/+/277455
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
3 years agotest: match gofrontend error messages
Ian Lance Taylor [Sat, 12 Dec 2020 03:53:32 +0000 (19:53 -0800)]
test: match gofrontend error messages

fixedbugs/issue14136.go:17:16: error: unknown field ‘X’ in ‘T’
fixedbugs/issue14136.go:18:13: error: incompatible type in initialization (cannot use type int as type string)

fixedbugs/issue14520.go:9:37: error: import path contains control character
fixedbugs/issue14520.go:14:2: error: expected ‘)’
fixedbugs/issue14520.go:14:3: error: expected declaration

fixedbugs/issue14652.go:9:7: error: use of undefined type ‘any’

fixedbugs/issue14729.go:13:17: error: embedded type may not be a pointer

fixedbugs/issue15514.dir/c.go:10: error: incompatible type in initialization

fixedbugs/issue15898.go:11:9: error: duplicate type in switch
fixedbugs/issue15898.go:16:9: error: duplicate type in switch

fixedbugs/issue16439.go:10:21: error: index expression is negative
fixedbugs/issue16439.go:13:21: error: index expression is negative
fixedbugs/issue16439.go:16:21: error: index expression is not integer constant
fixedbugs/issue16439.go:18:22: error: index expression is not integer constant

fixedbugs/issue17328.go:11:20: error: expected ‘{’
fixedbugs/issue17328.go:11:20: error: expected ‘;’ or ‘}’ or newline
fixedbugs/issue17328.go:13:1: error: expected declaration

fixedbugs/issue17588.go:14:15: error: expected type

fixedbugs/issue17631.go:20:17: error: unknown field ‘updates’ in ‘unnamed struct’

fixedbugs/issue17645.go:15:13: error: incompatible type in initialization

fixedbugs/issue17758.go:13:1: error: redefinition of ‘foo’
fixedbugs/issue17758.go:9:1: note: previous definition of ‘foo’ was here

fixedbugs/issue18092.go:13:19: error: expected colon

fixedbugs/issue18231.go:17:12: error: may only omit types within composite literals of slice, array, or map type

fixedbugs/issue18393.go:24:38: error: expected type

fixedbugs/issue18419.dir/test.go:12: error: reference to unexported field or method 'member'

fixedbugs/issue18655.go:14:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here
fixedbugs/issue18655.go:15:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here
fixedbugs/issue18655.go:16:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here
fixedbugs/issue18655.go:17:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here
fixedbugs/issue18655.go:18:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here
fixedbugs/issue18655.go:20:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here
fixedbugs/issue18655.go:21:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here
fixedbugs/issue18655.go:22:1: error: redefinition of ‘m’
fixedbugs/issue18655.go:13:1: note: previous definition of ‘m’ was here

fixedbugs/issue18915.go:13:20: error: expected ‘;’ after statement in if expression
fixedbugs/issue18915.go:16:21: error: parse error in for statement
fixedbugs/issue18915.go:19:24: error: expected ‘;’ after statement in switch expression
fixedbugs/issue18915.go:13:12: error: ‘a’ declared but not used
fixedbugs/issue18915.go:16:13: error: ‘b’ declared but not used
fixedbugs/issue18915.go:19:16: error: ‘c’ declared but not used

fixedbugs/issue19012.go:16:17: error: return with value in function with no return type
fixedbugs/issue19012.go:18:9: error: return with value in function with no return type
fixedbugs/issue19012.go:22:16: error: argument 2 has incompatible type (cannot use type bool as type uint)
fixedbugs/issue19012.go:22:9: error: too many arguments
fixedbugs/issue19012.go:22:16: error: incompatible types in binary expression
fixedbugs/issue19012.go:24:9: error: too many arguments

fixedbugs/issue19056.go:9:9: error: expected operand
fixedbugs/issue19056.go:9:9: error: expected ‘;’ or newline after top level declaration

fixedbugs/issue19482.go:25:15: error: expected struct field name
fixedbugs/issue19482.go:27:15: error: expected struct field name
fixedbugs/issue19482.go:31:19: error: expected struct field name
fixedbugs/issue19482.go:33:15: error: expected struct field name

fixedbugs/issue19667.go:13:1: error: expected operand
fixedbugs/issue19667.go:13:1: error: missing ‘)’
fixedbugs/issue19667.go:13:105: error: expected ‘;’ after statement in if expression
fixedbugs/issue19667.go:13:105: error: expected ‘{’
fixedbugs/issue19667.go:12:19: error: reference to undefined name ‘http’

Change-Id: Ia9c75b9c78671f354f0a0623dbc075157ef8f181
Reviewed-on: https://go-review.googlesource.com/c/go/+/277433
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agocmd/compile: fix incorrect shift count type with s390x rules
Ruixin Bao [Wed, 9 Dec 2020 21:55:37 +0000 (13:55 -0800)]
cmd/compile: fix incorrect shift count type with s390x rules

The type of the shift count must be an unsigned integer. Some s390x
rules for shift have their auxint type being int8. This results in a
compilation failure on s390x with an invalid operation when running
make.bash using older versions of go (e.g: go1.10.4).

This CL adds an auxint type of uint8 and changes the ops for shift and
rotate to use auxint with type uint8. The related rules are also
modified to address this change.

Fixes #43090

Change-Id: I594274b6e3d9b23092fc9e9f4b354870164f2f19
Reviewed-on: https://go-review.googlesource.com/c/go/+/277078
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>

3 years agocmd/go: print hint when 'go install' run without version outside module
Jay Conrod [Fri, 11 Dec 2020 21:45:39 +0000 (16:45 -0500)]
cmd/go: print hint when 'go install' run without version outside module

If 'go install' is invoked in module mode outside a module with a
package that could only be loaded from a module, it will now suggest
running 'go install pkg@latest'.

'go install' will still work outside a module on packages in std and
cmd, as well as .go files specified on the command line.

Fixes #42638

Change-Id: Ib0963935f028b7656178bc04a279b1114de35fbb
Reviewed-on: https://go-review.googlesource.com/c/go/+/277355
Run-TryBot: Jay Conrod <jayconrod@google.com>
Trust: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
3 years agocmd/go: refactor error reporting in internal/load
Jay Conrod [Fri, 11 Dec 2020 21:45:28 +0000 (16:45 -0500)]
cmd/go: refactor error reporting in internal/load

Replaced load.PackagesForBuild with a new function,
load.CheckPackageErrors. Callers should now call PackagesAndErrors,
then CheckPackageErrors for the same functionality.

Removed load.Packages. Callers should call base.Errorf and filter the
package list as needed.

This gives callers more flexibility in handling package load errors.

For #42638

Change-Id: Id75463ba695adc1ca3f8693ceb2c8978b74a3500
Reviewed-on: https://go-review.googlesource.com/c/go/+/277354
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
3 years agocmd/compile: set correct type for OpIData
Cuong Manh Le [Mon, 14 Dec 2020 02:45:44 +0000 (09:45 +0700)]
cmd/compile: set correct type for OpIData

Since CL 270057, there're many attempts to fix the expand_calls pass
with interface{}-typed. But all of them did not fix the root cause. The
main issue is during SSA conversion in gc/ssa.go, for empty interface
case, we make its type as n.Type, instead of BytePtr.

To fix these, we can just use BytePtr for now, since when itab fields
are treated as scalar.

No significal changes on compiler speed, size.

cmd/compile/internal/ssa
expandCalls.func6 9488 -> 9232  (-2.70%)

file                       before   after    Δ       %
cmd/compile/internal/ssa.s 3992893  3992637  -256    -0.006%
total                      20500447 20500191 -256    -0.001%

Fixes #43112
Updates #42784
Updates #42727
Updates #42568

Change-Id: I0b15d9434e0be5448453e61f98ef9c2d6cd93792
Reviewed-on: https://go-review.googlesource.com/c/go/+/276952
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: Keith Randall <khr@golang.org>
3 years agodoc: make clear that Go 1.4 is not required for bootstrap
Russ Cox [Fri, 11 Dec 2020 18:32:14 +0000 (13:32 -0500)]
doc: make clear that Go 1.4 is not required for bootstrap

Go 1.4 does not work on some systems, including the most
recent versions of macOS. Make it clearer that that's not the only
way to bootstrap Go.

Change-Id: I7c03d6808e43bf26283a53eab2bb0b2dc4af73af
Reviewed-on: https://go-review.googlesource.com/c/go/+/277216
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agocmd/compile: fix select statement evaluation order corner case
Matthew Dempsky [Thu, 10 Dec 2020 20:21:45 +0000 (12:21 -0800)]
cmd/compile: fix select statement evaluation order corner case

The Go spec requires that select case clauses be evaluated in order,
which is stricter than normal ordering semantics. cmd/compile handled
this correctly for send clauses, but was not correctly handling
receive clauses that involved bare variable references.

Discovered with @cuonglm.

Fixes #43111.

Change-Id: Iec93b6514dd771875b084ba49c15d7f4531b4a6f
Reviewed-on: https://go-review.googlesource.com/c/go/+/277132
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
3 years agocmd/go: add documentation for the -overlay flag
Michael Matloob [Wed, 2 Dec 2020 02:45:49 +0000 (21:45 -0500)]
cmd/go: add documentation for the -overlay flag

Also add -overlay to the Go 1.16 release notes.

For #40700
Fixes #39958
Fixes #42893

Change-Id: Ifd397549e368b255e7b8800986cfa0563a942af5
Reviewed-on: https://go-review.googlesource.com/c/go/+/274714
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>
Reviewed-by: Jay Conrod <jayconrod@google.com>
3 years agocmd/link/internal/loadelf: support additional ELF relocations on mips64
Joel Sing [Mon, 7 Dec 2020 17:23:36 +0000 (04:23 +1100)]
cmd/link/internal/loadelf: support additional ELF relocations on mips64

LLVM on openbsd/mips64 generates R_MIPS_GOT_HI16 and R_MIPS_GOT_LO16 relocations,
so teach cmd/link/internal/loadelf about both of these.

Updates #43005

Change-Id: Ic45ea8b901d44dcbdbf355411ee434dcd7670a92
Reviewed-on: https://go-review.googlesource.com/c/go/+/275894
Trust: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agocmd/vet: vendor in x/tools, update structtag vet check
Ian Lance Taylor [Fri, 11 Dec 2020 06:24:21 +0000 (22:24 -0800)]
cmd/vet: vendor in x/tools, update structtag vet check

For #40281
Fixes #43083

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

3 years agosyscall: drop references to Unix epoch in Timeval/Timespec docs
Ian Lance Taylor [Thu, 10 Dec 2020 23:01:20 +0000 (15:01 -0800)]
syscall: drop references to Unix epoch in Timeval/Timespec docs

The various conversion functions just change the format of time values.
They don't use the Unix epoch. Although in practice the values are often
times since the Unix epoch, they aren't always, so referring to the
epoch can be confusing.

Fixes #43010

Change-Id: I640d665f0d2017f0974db05d70858037c7c91eda
Reviewed-on: https://go-review.googlesource.com/c/go/+/277073
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>

3 years agodoc/go1.16: add vet release note for CL 235677
Tim King [Wed, 2 Dec 2020 01:55:35 +0000 (17:55 -0800)]
doc/go1.16: add vet release note for CL 235677

For #40700
Fixes #42895

Change-Id: I05b60f0d000512d5dddb3d61e0e695aa01943d6a
Reviewed-on: https://go-review.googlesource.com/c/go/+/274617
Trust: Tim King <taking@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
3 years agodoc/go1.16: address some remaining high-level TODOs
Dmitri Shuralyov [Thu, 10 Dec 2020 22:43:09 +0000 (17:43 -0500)]
doc/go1.16: address some remaining high-level TODOs

The tools section TODO can be removed since the tools section looks
complete by now.

All TODOs in the minor changes to the library section have been done,
so the top-level TODO is resolved. Delete it.

The currently highlighted entries under Core library section look
good. It's worth reviewing this further based on feedback from Go
1.16 pre-releases, so keep the TODO but make it non-user-visible
to unblock Go 1.16 Beta 1.

For #40700.

Change-Id: Ie72661bd457b0a93ef92e1bfc0844072f3b618a6
Reviewed-on: https://go-review.googlesource.com/c/go/+/277212
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agocmd/go: encode backslash and newline in response files
Jeremy Faller [Tue, 24 Nov 2020 17:58:21 +0000 (12:58 -0500)]
cmd/go: encode backslash and newline in response files

Fixes #42295

Change-Id: Ie324bc99a74c1d864c6c2da2e7b929b338c2e033
Reviewed-on: https://go-review.googlesource.com/c/go/+/272870
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
3 years agoruntime/metrics: add a note about floating-point values to package docs
Michael Anthony Knyszek [Mon, 7 Dec 2020 15:10:43 +0000 (15:10 +0000)]
runtime/metrics: add a note about floating-point values to package docs

This change adds a note to the package documentation that the package
will never produce a NaN or infinity, to help ease usability.

Change-Id: I72ff6ab636ca23722a68ef11e707c68b0724ac04
Reviewed-on: https://go-review.googlesource.com/c/go/+/275854
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Trust: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
3 years agoruntime/metrics: expand Read documention with caveats
Michael Anthony Knyszek [Mon, 7 Dec 2020 15:03:51 +0000 (15:03 +0000)]
runtime/metrics: expand Read documention with caveats

This change modifies the documentation of Read with some caveats about
reusing the slice passed in to Read as well as with what concurrent
situations are safe.

Change-Id: I76fd31acc67ae384546a8442dfbf9d16b7445cff
Reviewed-on: https://go-review.googlesource.com/c/go/+/275853
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
3 years agoruntime/metrics: add ordering line to supported metrics docs
Michael Anthony Knyszek [Fri, 4 Dec 2020 16:04:53 +0000 (16:04 +0000)]
runtime/metrics: add ordering line to supported metrics docs

This change adds an additional line explaining the ordering of the
supported metrics list. It's also necessary to ensure "Supported
metrics" is displayed by godoc as a proper header.

This modification does mean the description test, that ensures
descriptions line up with documentation, needs to change slightly
so it it doesn't read this new line as documentation. Make this
new line the line the test uses to decide when to begin.

Change-Id: I654c1c20e97a80ea79c8eb864445153ce91950bf
Reviewed-on: https://go-review.googlesource.com/c/go/+/275852
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
3 years agotest: match gofrontend error messages
Ian Lance Taylor [Thu, 10 Dec 2020 02:51:12 +0000 (18:51 -0800)]
test: match gofrontend error messages

fixedbugs/bug13343.go:10:12: error: initialization expressions for ‘b’ and ‘c’ depend upon each other
fixedbugs/bug13343.go:11:9: note: ‘c’ defined here
fixedbugs/bug13343.go:11:9: error: initialization expression for ‘c’ depends upon itself
fixedbugs/bug13343.go:11:9: error: initialization expressions for ‘c’ and ‘b’ depend upon each other
fixedbugs/bug13343.go:10:12: note: ‘b’ defined here

fixedbugs/issue10700.dir/test.go:24:10: error: reference to method ‘Do’ in type that is pointer to interface, not interface
fixedbugs/issue10700.dir/test.go:25:10: error: reference to method ‘do’ in type that is pointer to interface, not interface
fixedbugs/issue10700.dir/test.go:27:10: error: reference to method ‘Dont’ in type that is pointer to interface, not interface
fixedbugs/issue10700.dir/test.go:28:13: error: reference to undefined field or method ‘Dont’
fixedbugs/issue10700.dir/test.go:31:10: error: reference to undefined field or method ‘do’
fixedbugs/issue10700.dir/test.go:33:13: error: reference to undefined field or method ‘do’
fixedbugs/issue10700.dir/test.go:34:10: error: reference to undefined field or method ‘Dont’
fixedbugs/issue10700.dir/test.go:35:13: error: reference to undefined field or method ‘Dont’
fixedbugs/issue10700.dir/test.go:37:10: error: reference to method ‘Do’ in type that is pointer to interface, not interface
fixedbugs/issue10700.dir/test.go:38:10: error: reference to method ‘do’ in type that is pointer to interface, not interface
fixedbugs/issue10700.dir/test.go:40:13: error: reference to undefined field or method ‘do’
fixedbugs/issue10700.dir/test.go:41:10: error: reference to method ‘Dont’ in type that is pointer to interface, not interface
fixedbugs/issue10700.dir/test.go:42:13: error: reference to undefined field or method ‘Dont’
fixedbugs/issue10700.dir/test.go:43:10: error: reference to method ‘secret’ in type that is pointer to interface, not interface
fixedbugs/issue10700.dir/test.go:44:13: error: reference to unexported field or method ‘secret’

fixedbugs/issue10975.go:13:9: error: interface contains embedded non-interface

fixedbugs/issue11326.go:26:17: error: floating-point constant overflow
fixedbugs/issue11326.go:27:17: error: floating-point constant overflow
fixedbugs/issue11326.go:28:17: error: floating-point constant overflow

fixedbugs/issue11361.go:9:11: error: import file ‘fmt’ not found
fixedbugs/issue11361.go:11:11: error: reference to undefined name ‘fmt’

fixedbugs/issue11371.go:12:15: error: floating-point constant truncated to integer
fixedbugs/issue11371.go:13:15: error: integer constant overflow
fixedbugs/issue11371.go:17:15: error: floating-point constant truncated to integer

fixedbugs/issue11590.go:9:17: error: integer constant overflow
fixedbugs/issue11590.go:9:17: error: integer constant overflow
fixedbugs/issue11590.go:10:22: error: complex real part overflow
fixedbugs/issue11590.go:10:22: error: complex real part overflow
fixedbugs/issue11590.go:11:23: error: complex real part overflow
fixedbugs/issue11590.go:11:23: error: complex real part overflow
fixedbugs/issue11590.go:9:19: error: integer constant overflow
fixedbugs/issue11590.go:10:24: error: complex real part overflow
fixedbugs/issue11590.go:11:25: error: complex real part overflow

fixedbugs/issue11610.go:11:7: error: import path is empty
fixedbugs/issue11610.go:12:4: error: invalid character 0x3f in input file
fixedbugs/issue11610.go:14:1: error: expected identifier
fixedbugs/issue11610.go:14:1: error: expected type

fixedbugs/issue11614.go:14:9: error: interface contains embedded non-interface

fixedbugs/issue13248.go:13:1: error: expected operand
fixedbugs/issue13248.go:13:1: error: missing ‘)’
fixedbugs/issue13248.go:12:5: error: reference to undefined name ‘foo’

fixedbugs/issue13266.go:10:8: error: package name must be an identifier
fixedbugs/issue13266.go:10:8: error: expected ‘;’ or newline after package clause
fixedbugs/issue13266.go:10:8: error: expected declaration

fixedbugs/issue13273.go:50:18: error: expected ‘chan’
fixedbugs/issue13273.go:53:24: error: expected ‘chan’

fixedbugs/issue13274.go:11:58: error: expected ‘}’

fixedbugs/issue13365.go:14:19: error: index expression is negative
fixedbugs/issue13365.go:15:21: error: index expression is negative
fixedbugs/issue13365.go:16:22: error: index expression is negative
fixedbugs/issue13365.go:19:13: error: some element keys in composite literal are out of range
fixedbugs/issue13365.go:22:19: error: incompatible type for element 1 in composite literal
fixedbugs/issue13365.go:23:21: error: incompatible type for element 1 in composite literal
fixedbugs/issue13365.go:24:22: error: incompatible type for element 1 in composite literal

fixedbugs/issue13415.go:14:5: error: redefinition of ‘x’
fixedbugs/issue13415.go:14:5: note: previous definition of ‘x’ was here
fixedbugs/issue13415.go:14:5: error: ‘x’ declared but not used

fixedbugs/issue13471.go:12:25: error: floating-point constant truncated to integer
fixedbugs/issue13471.go:13:25: error: floating-point constant truncated to integer
fixedbugs/issue13471.go:14:25: error: floating-point constant truncated to integer
fixedbugs/issue13471.go:15:24: error: floating-point constant truncated to integer
fixedbugs/issue13471.go:16:23: error: floating-point constant truncated to integer
fixedbugs/issue13471.go:18:26: error: floating-point constant truncated to integer
fixedbugs/issue13471.go:19:26: error: floating-point constant truncated to integer
fixedbugs/issue13471.go:20:26: error: floating-point constant truncated to integer
fixedbugs/issue13471.go:21:25: error: floating-point constant truncated to integer
fixedbugs/issue13471.go:22:24: error: floating-point constant truncated to integer
fixedbugs/issue13471.go:24:24: error: floating-point constant truncated to integer

fixedbugs/issue13821b.go:18:12: error: incompatible types in binary expression
fixedbugs/issue13821b.go:19:13: error: incompatible types in binary expression
fixedbugs/issue13821b.go:20:13: error: incompatible types in binary expression
fixedbugs/issue13821b.go:21:13: error: incompatible types in binary expression
fixedbugs/issue13821b.go:22:13: error: incompatible types in binary expression
fixedbugs/issue13821b.go:24:12: error: incompatible types in binary expression

fixedbugs/issue14006.go:24:18: error: expected ‘;’ or ‘}’ or newline
fixedbugs/issue14006.go:30:18: error: expected ‘;’ or ‘}’ or newline
fixedbugs/issue14006.go:37:22: error: expected ‘;’ or ‘}’ or newline
fixedbugs/issue14006.go:43:22: error: expected ‘;’ or ‘}’ or newline
fixedbugs/issue14006.go:59:17: note: previous definition of ‘labelname’ was here
fixedbugs/issue14006.go:64:17: error: label ‘labelname’ already defined
fixedbugs/issue14006.go:24:17: error: value computed is not used
fixedbugs/issue14006.go:30:17: error: value computed is not used
fixedbugs/issue14006.go:37:20: error: value computed is not used
fixedbugs/issue14006.go:43:20: error: value computed is not used
fixedbugs/issue14006.go:59:17: error: label ‘labelname’ defined and not used

fixedbugs/issue14010.go:13:14: error: invalid left hand side of assignment
fixedbugs/issue14010.go:14:14: error: invalid left hand side of assignment
fixedbugs/issue14010.go:14:9: error: invalid use of type

fixedbugs/issue14321.go:30:10: error: method ‘F’ is ambiguous in type ‘C’
fixedbugs/issue14321.go:31:10: error: ‘G’ is ambiguous via ‘A’ and ‘B’
fixedbugs/issue14321.go:33:10: error: type ‘C’ has no method ‘I’

fixedbugs/issue8183.go:12:14: error: integer constant overflow

fixedbugs/issue9036.go:21:12: error: invalid prefix for floating constant
fixedbugs/issue9036.go:22:12: error: invalid prefix for floating constant

fixedbugs/issue9076.go:14:5: error: incompatible type in initialization (cannot use type uintptr as type int32)
fixedbugs/issue9076.go:15:5: error: incompatible type in initialization (cannot use type uintptr as type int32)

For issue9083.go avoid an error about a variable that is set but not used.

fixedbugs/issue9370.go:105:13: error: cannot use ‘_’ as value
fixedbugs/issue9370.go:106:13: error: cannot use ‘_’ as value
fixedbugs/issue9370.go:107:13: error: cannot use ‘_’ as value
fixedbugs/issue9370.go:108:13: error: cannot use ‘_’ as value
fixedbugs/issue9370.go:109:13: error: cannot use ‘_’ as value
fixedbugs/issue9370.go:110:13: error: cannot use ‘_’ as value
fixedbugs/issue9370.go:112:18: error: cannot use ‘_’ as value
fixedbugs/issue9370.go:113:18: error: cannot use ‘_’ as value
fixedbugs/issue9370.go:114:18: error: cannot use ‘_’ as value
fixedbugs/issue9370.go:115:18: error: cannot use ‘_’ as value
fixedbugs/issue9370.go:116:18: error: cannot use ‘_’ as value
fixedbugs/issue9370.go:117:18: error: cannot use ‘_’ as value
fixedbugs/issue9370.go:119:13: error: cannot use ‘_’ as value
fixedbugs/issue9370.go:119:18: error: cannot use ‘_’ as value
fixedbugs/issue9370.go:36:15: error: invalid comparison of non-ordered type
fixedbugs/issue9370.go:39:15: error: invalid comparison of non-ordered type
fixedbugs/issue9370.go:43:15: error: invalid comparison of non-ordered type
fixedbugs/issue9370.go:46:15: error: invalid comparison of non-ordered type
fixedbugs/issue9370.go:50:15: error: invalid comparison of non-ordered type
fixedbugs/issue9370.go:53:15: error: invalid comparison of non-ordered type
fixedbugs/issue9370.go:56:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:57:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:58:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:59:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:60:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:61:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:65:15: error: invalid comparison of non-ordered type
fixedbugs/issue9370.go:68:15: error: invalid comparison of non-ordered type
fixedbugs/issue9370.go:70:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:71:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:72:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:73:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:74:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:75:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:77:15: error: invalid operation (func can only be compared to nil)
fixedbugs/issue9370.go:78:15: error: invalid operation (func can only be compared to nil)
fixedbugs/issue9370.go:79:15: error: invalid comparison of non-ordered type
fixedbugs/issue9370.go:80:15: error: invalid operation (func can only be compared to nil)
fixedbugs/issue9370.go:81:15: error: invalid operation (func can only be compared to nil)
fixedbugs/issue9370.go:82:15: error: invalid comparison of non-ordered type
fixedbugs/issue9370.go:84:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:85:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:86:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:87:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:88:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:89:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:91:15: error: invalid operation (func can only be compared to nil)
fixedbugs/issue9370.go:92:15: error: invalid operation (func can only be compared to nil)
fixedbugs/issue9370.go:93:15: error: invalid comparison of non-ordered type
fixedbugs/issue9370.go:94:15: error: invalid operation (func can only be compared to nil)
fixedbugs/issue9370.go:95:15: error: invalid operation (func can only be compared to nil)
fixedbugs/issue9370.go:96:15: error: invalid comparison of non-ordered type
fixedbugs/issue9370.go:98:15: error: invalid operation (func can only be compared to nil)
fixedbugs/issue9370.go:99:15: error: invalid operation (func can only be compared to nil)
fixedbugs/issue9370.go:100:15: error: invalid comparison of non-ordered type
fixedbugs/issue9370.go:101:15: error: invalid operation (func can only be compared to nil)
fixedbugs/issue9370.go:102:15: error: invalid operation (func can only be compared to nil)
fixedbugs/issue9370.go:103:15: error: invalid comparison of non-ordered type
fixedbugs/issue9370.go:121:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:122:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:123:15: error: incompatible types in binary expression
fixedbugs/issue9370.go:124:15: error: incompatible types in binary expression

Change-Id: I4089de4919112b08f5f2bbec20f84fcc7dbe3955
Reviewed-on: https://go-review.googlesource.com/c/go/+/276832
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
3 years agostd: update golang.org/x/net to 20201209123823-ac852fbbde11
Dmitri Shuralyov [Thu, 10 Dec 2020 17:50:55 +0000 (12:50 -0500)]
std: update golang.org/x/net to 20201209123823-ac852fbbde11

Done with:

go get -d golang.org/x/net@latest
go mod tidy
go mod vendor
go generate -run bundle std

The cmd module was updated as well, but go mod tidy undoes the change
because the x/net module doesn't contribute any packages to cmd module.
cmd/internal/moddeps.TestDependencyVersionsConsistent is happy with it:

// It's ok if there are undetected differences in modules that do not
// provide imported packages: we will not have to pull in any backports of
// fixes to those modules anyway.

Fixes #31192.
Updates #42498.

Change-Id: If303c9a7aa2ce8c2553fcb1ced7fccc9e6652ad6
Reviewed-on: https://go-review.googlesource.com/c/go/+/277012
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
3 years agodatabase/sql: fix typo in comment
Hein Khant Zaw [Thu, 10 Dec 2020 16:45:48 +0000 (16:45 +0000)]
database/sql: fix typo in comment

Fixes #43116

Change-Id: Ib04fab6ae03f322aa1508ec00523f628d891247a
GitHub-Last-Rev: 0a86e665b2c320e0b2aef75ee53bd7281b19b013
GitHub-Pull-Request: golang/go#43122
Reviewed-on: https://go-review.googlesource.com/c/go/+/276992
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
3 years agocmd/go, cmd/asm: pass -linkshared to assembler for shared linkage builds
Than McIntosh [Thu, 10 Dec 2020 13:44:44 +0000 (08:44 -0500)]
cmd/go, cmd/asm: pass -linkshared to assembler for shared linkage builds

When the -linkshared build mode is in effect, the Go command passes
the "-linkshared" command line option to the compiler so as to insure
special handling for things like builtin functions (which may appear
in a shared library and not the main executable). This patch extends
this behavior to the assembler, since the assembler may also wind up
referencing builtins when emitting a stack-split prolog.

Fixes #43107.

Change-Id: I56eaded79789b083f3c3d800fb140353dee33ba9
Reviewed-on: https://go-review.googlesource.com/c/go/+/276932
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agocmd/link: reject too-large relocation addend on darwin/arm64
Cherry Zhang [Wed, 9 Dec 2020 17:14:00 +0000 (12:14 -0500)]
cmd/link: reject too-large relocation addend on darwin/arm64

Mach-O relocation addend is signed 24-bit. If the addend
overflows, it is better to fail the build than emitting an
incorrect binary. (I'm still working on a fix.)

Updates #42738.

Change-Id: I647f0cd4f6b84d9ac75ef3bf36673bea01dfc211
Reviewed-on: https://go-review.googlesource.com/c/go/+/276694
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
3 years agocmd/link: truncate file after code signature
Cherry Zhang [Wed, 9 Dec 2020 23:25:05 +0000 (18:25 -0500)]
cmd/link: truncate file after code signature

When external linking, in case that the external linker generates
a code signature with a different size (e.g. as it uses a
different identifier), truncate the file after rewriting the code
signature, to make sure that no bytes after the signature (which
will invalidate the signature).

Fixes #43105.

Change-Id: I732f949fedd6de42d9f3cf6d017f7ba3f4e59e7a
Reviewed-on: https://go-review.googlesource.com/c/go/+/276693
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
3 years agocmd/compile: don't constant fold divide by zero
Keith Randall [Wed, 9 Dec 2020 16:27:54 +0000 (08:27 -0800)]
cmd/compile: don't constant fold divide by zero

It just makes the compiler crash. Oops.

Fixes #43099

Change-Id: Id996c14799c1a5d0063ecae3b8770568161c2440
Reviewed-on: https://go-review.googlesource.com/c/go/+/276652
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agogo/types: avoid endless recursion in the Comparable predicate
Rob Findley [Wed, 9 Dec 2020 11:10:52 +0000 (06:10 -0500)]
go/types: avoid endless recursion in the Comparable predicate

This is a port of CL 276374 from the dev.typeparams branch. Avoid an
endless recursion in Comparable by tracking types that have already been
considered.

Fixes #43088

Change-Id: I927b29ac544df9bfb5c8c04699d57fafe6cfff73
Reviewed-on: https://go-review.googlesource.com/c/go/+/276552
Run-TryBot: Robert Findley <rfindley@google.com>
Trust: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
3 years agoall: update to use os.ReadDir where appropriate
Russ Cox [Thu, 29 Oct 2020 18:46:29 +0000 (14:46 -0400)]
all: update to use os.ReadDir where appropriate

os.ReadDir is a replacement for ioutil.ReadDir that returns
a slice of fs.DirEntry instead of fs.FileInfo, meaning it is the
more efficient form.

This CL updates call sites throughout the Go source tree
wherever possible. As usual, code built using the Go 1.4
bootstrap toolchain is not included. There is also a use in
go/build that appears in the public API and can't be changed,
at least not without additional changes.

Fixes #42026.

Change-Id: Icfc9dd52c6045020f6830e22c72128499462d561
Reviewed-on: https://go-review.googlesource.com/c/go/+/266366
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agoall: update to use os.ReadFile, os.WriteFile, os.CreateTemp, os.MkdirTemp
Russ Cox [Thu, 29 Oct 2020 18:17:47 +0000 (14:17 -0400)]
all: update to use os.ReadFile, os.WriteFile, os.CreateTemp, os.MkdirTemp

As part of #42026, these helpers from io/ioutil were moved to os.
(ioutil.TempFile and TempDir became os.CreateTemp and MkdirTemp.)

Update the Go tree to use the preferred names.

As usual, code compiled with the Go 1.4 bootstrap toolchain
and code vendored from other sources is excluded.

ReadDir changes are in a separate CL, because they are not a
simple search and replace.

For #42026.

Change-Id: If318df0216d57e95ea0c4093b89f65e5b0ababb3
Reviewed-on: https://go-review.googlesource.com/c/go/+/266365
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agoruntime/metrics: simplify test to support more environments
Dmitri Shuralyov [Wed, 9 Dec 2020 00:44:33 +0000 (19:44 -0500)]
runtime/metrics: simplify test to support more environments

go test sets the working directory to that of the package being tested,
so opening one of the package source files can be done in a simpler way.
This also allows the test to run in more environments, for example when
GOROOT_FINAL¹ is set.

Also remove the testenv.HasSrc-like check for Go source. The doc.go
file is a part of the package being built and tested, so it's expected
to be available. If it's important for this test to handle when a test
binary is built with go test -c and executed elsewhere without package
source files, something more than testenv.HasSrc would be needed.

¹ https://golang.org/cmd/go/#hdr-Environment_variables

Fixes #43085.

Change-Id: Ie6ade395a8fc7beebdadbad6f4873800138dfc26
Reviewed-on: https://go-review.googlesource.com/c/go/+/276452
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Trust: Dmitri Shuralyov <dmitshur@golang.org>

3 years agocmd/compile: fix message typo
Ikko Ashimine [Wed, 9 Dec 2020 14:17:56 +0000 (14:17 +0000)]
cmd/compile: fix message typo

occurences -> occurrences

Change-Id: Ia81671f5de8a24ddd303a77b4580e8c726f29122
GitHub-Last-Rev: 11f9ab9f8c2c9acd70bcf170930426547d9b63eb
GitHub-Pull-Request: golang/go#43097
Reviewed-on: https://go-review.googlesource.com/c/go/+/276612
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
3 years agonet/http: add connections back that haven't been canceled
Michael Fraenkel [Thu, 3 Dec 2020 00:07:27 +0000 (17:07 -0700)]
net/http: add connections back that haven't been canceled

Issue #41600 fixed the issue when a second request canceled a connection
while the first request was still in roundTrip.
This uncovered a second issue where a request was being canceled (in
roundtrip) but the connection was put back into the idle pool for a
subsequent request.
The fix is the similar except its now in readLoop instead of roundTrip.
A persistent connection is only added back if it successfully removed
the cancel function; otherwise we know the roundTrip has started
cancelRequest.

Fixes #42942

Change-Id: Ia56add20880ccd0c1ab812d380d8628e45f6f44c
Reviewed-on: https://go-review.googlesource.com/c/go/+/274973
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Damien Neil <dneil@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
3 years agoruntime: prevent stack growth after fork in runtime.sigfillset
Haoran Luo [Tue, 8 Dec 2020 14:29:04 +0000 (14:29 +0000)]
runtime: prevent stack growth after fork in runtime.sigfillset

This fixes the unexpected growth of stack in child process, which
is caused by stack checking code in runtime.sigfillset called from
runtime.sigset while clearing the signal handlers in child process.

The redundant stack checking code is generated due to missing
'//go:nosplit' directive that should be annotated for
runtime.sigfillset.

Fixes #43066
Updates #21314

Change-Id: I9483a962a4b0747074313991841e2440ee32198c
Reviewed-on: https://go-review.googlesource.com/c/go/+/276173
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
3 years agodoc: add description of new framepointer vet check
Keith Randall [Tue, 8 Dec 2020 22:35:41 +0000 (14:35 -0800)]
doc: add description of new framepointer vet check

Update #43014

Change-Id: I5fbfaa16e6acb8859fd0b1188f532f5a225f6349
Reviewed-on: https://go-review.googlesource.com/c/go/+/276373
Trust: Keith Randall <khr@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
3 years agocmd/vet: vendor in x/tools, enable framepointer vet check
Keith Randall [Tue, 8 Dec 2020 22:07:19 +0000 (14:07 -0800)]
cmd/vet: vendor in x/tools, enable framepointer vet check

Vendor in latest x/tools.
Add framepointer vet check to vet.

Fixes #43014

Change-Id: Ife72f85b1261aa60c0028041c58040d60a40918a
Reviewed-on: https://go-review.googlesource.com/c/go/+/276372
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>

3 years agogo/types: correct error position for inherited const init expressions
Rob Findley [Tue, 8 Dec 2020 14:44:48 +0000 (09:44 -0500)]
go/types: correct error position for inherited const init expressions

This is a port of CL 275517 from the dev.typeparams branch, to fix the
positioning of error messages for invalid const init expressions that
are inherited.

Differences from CL 275517:
 + The inherited flag is added to the constDecl intermediate
   representation.
 + The errpos override is made a positioner, the internal interface
   used by go/types to capture error position and span. For const decls
   errpos is just set to a singular point, but using positioner is
   correct and causes span start and end positions to also be
   overridden.
 + Test cases are updated to assert on just 'overflows', as the go/types
   error message is, for example, "cannot use 255 + iota (untyped int
   constant 256) as byte value in constant declaration (overflows)".
   This is more verbose than the compiler's "constant 256 overflows
   byte", but changing that is out of scope.

Fixes #42991

Change-Id: I0a71d2290f7fff5513f2a6e49b83e6f0f4da30e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/276172
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
3 years agodoc/go1.16: improve channel race detector changes description
Austin Clements [Mon, 7 Dec 2020 02:20:15 +0000 (21:20 -0500)]
doc/go1.16: improve channel race detector changes description

Based on text from Daniel Fava.

For #40700.

Change-Id: I0bc3a4340b8a777ff96d3cf226a7d51d3f65db2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/275786
Trust: Austin Clements <austin@google.com>
Reviewed-by: Daniel Fava <danielsfava@gmail.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
3 years agoruntime: correct sigfwd on openbsd/mips64
Joel Sing [Mon, 7 Dec 2020 17:21:33 +0000 (04:21 +1100)]
runtime: correct sigfwd on openbsd/mips64

Position independent code expects that R25 (aka $t9) contains the address of the
called function. As such, use R25 when calling from sigfwd.

Change-Id: I66b2b9bfa1f1bb983c7385eb2eaa19d9cd87d9fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/275893
Trust: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agodoc/go1.16: update linker stats
Austin Clements [Mon, 7 Dec 2020 22:15:06 +0000 (17:15 -0500)]
doc/go1.16: update linker stats

benchstat v2 comparison vs HEAD:

                    1.15.6                    1.16
                    sec/op       sec/op           vs base
LinkIstio-48        4.44 ± 1%   3.43 ± 1%  -22.79% (p=0.000 n=20)
LinkKubelet-48     10.89 ± 1%   8.42 ± 1%  -22.63% (p=0.000 n=20)
LinkDiscovery-48    1.43 ± 1%   1.06 ± 1%  -25.68% (p=0.000 n=20)
LinkIstio-4         4.50 ± 1%   3.52 ± 1%  -21.84% (p=0.000 n=20)
LinkKubelet-4      10.84 ± 2%   8.55 ± 1%  -21.09% (p=0.000 n=20)
LinkDiscovery-4     1.45 ± 2%   1.11 ± 2%  -23.81% (p=0.000 n=20)

                     1.15.6                      1.16
                  max-RSS-bytes  max-RSS-bytes         vs base
LinkIstio-48       1085Mi ± 1%    1006Mi ± 0%    -7.32% (p=0.000 n=20)
LinkKubelet-48     1.60Gi ± 5%    1.46Gi ± 1%    -8.57% (p=0.000 n=20)
LinkDiscovery-48    392Mi ± 1%     362Mi ± 2%    -7.71% (p=0.000 n=20)
LinkIstio-4        1022Mi ± 6%     958Mi ± 1%    -6.26% (p=0.000 n=20)
LinkKubelet-4      1.63Gi ± 2%    1.44Gi ± 0%   -11.44% (p=0.000 n=20)
LinkDiscovery-4     400Mi ± 0%     353Mi ± 1%   -11.83% (p=0.000 n=20)

                     1.15.6                    1.16
                   exe-bytes     exe-bytes           vs base
LinkIstio-48       97.7Mi ± 0%   93.4Mi ± 0%  -4.38% (p=0.000 n=20)
LinkKubelet-48      129Mi ± 0%    127Mi ± 0%  -1.17% (p=0.000 n=20)
LinkDiscovery-48   31.9Mi ± 0%   29.1Mi ± 0%  -8.67% (p=0.000 n=20)
LinkIstio-4        97.7Mi ± 0%   93.4Mi ± 0%  -4.38% (p=0.000 n=20)
LinkKubelet-4       129Mi ± 0%    127Mi ± 0%  -1.17% (p=0.000 n=20)
LinkDiscovery-4    31.9Mi ± 0%   29.1Mi ± 0%  -8.67% (p=0.000 n=20)

https://perf.golang.org/search?q=upload:20201207.6

For #40700.

Change-Id: I3f7b3e08db4fb7980d2472f15e5fc04503e95ea0
Reviewed-on: https://go-review.googlesource.com/c/go/+/275912
Trust: Austin Clements <austin@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agoreflect: document multiple keys in struct tags
Ian Lance Taylor [Thu, 3 Dec 2020 02:25:19 +0000 (18:25 -0800)]
reflect: document multiple keys in struct tags

For #40281
Fixes #42959

Change-Id: Ibc4769fda1592a1373ec720ea30baf319c0a0136
Reviewed-on: https://go-review.googlesource.com/c/go/+/274448
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
3 years agoio/fs: fix Sub method error text
Russ Cox [Mon, 7 Dec 2020 20:20:37 +0000 (15:20 -0500)]
io/fs: fix Sub method error text

Noticed in (and alternative to) CL 275520.

Change-Id: If6c107ee9928dd1910facd4dc66da7234cb91c39
Reviewed-on: https://go-review.googlesource.com/c/go/+/275879
Trust: Russ Cox <rsc@golang.org>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>