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

51291 Commits

Author SHA1 Message Date
Ian Lance Taylor
1c8f9d2c97 doc/go1.18: mention new cmd/go fuzzing flags
For #47694

Change-Id: I00da9bd39700e938ec492daa71aba2035d911a06
Reviewed-on: https://go-review.googlesource.com/c/go/+/374354
Trust: Ian Lance Taylor <iant@golang.org>
Trust: Katie Hockman <katie@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
2022-01-04 21:10:15 +00:00
Jonathan Amsterdam
95b240b2cd go/doc: handle generic receiver strings
A receiver expression for a type with parameters may be an IndexExpr
or IndexListExpr in addition to an Ident or StarExpr. Add cases to
recvString to account for the new types.

Add tests that compare the fields of Func, and the fields of Type that
hold Funcs. These fields weren't previously tested.

Change-Id: Ia2cef51c85113422e0c5745c77dddcd53507ee51
Reviewed-on: https://go-review.googlesource.com/c/go/+/375095
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-01-03 23:45:12 +00:00
Jonathan Amsterdam
a893d0f464 go/doc: use subtests
Change the Test function to use sub-tests for each doc mode and
package.

This will allow more fine-grained test execution.

Change-Id: Ie3dda5791bda2781a60776886dd39fd18e670e24
Reviewed-on: https://go-review.googlesource.com/c/go/+/375094
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-01-03 23:45:06 +00:00
Tobias Klauser
c8861432b8 os: simplify ios checks in tests
Go 1.16 renamed the iOS port from darwin/arm64 to ios/arm64 and
darwin/arm64 was repurposed for the macOS ARM64 port (see
https://golang.org/doc/go1.16#darwin).

Change tests to only use GOOS=ios to detect special cases for iOS and
stop treating darwin/arm64 as iOS.

Change-Id: I6a19f16fa9ec159ab1386aeb8fe912585e457171
Reviewed-on: https://go-review.googlesource.com/c/go/+/374399
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-01-02 14:27:43 +00:00
Tobias Klauser
d181885de8 os: enable TestMkdirAllWithSymlink on darwin/arm64
Go 1.16 renamed the iOS port from darwin/arm64 to ios/arm64 and
darwin/arm64 was repurposed for the macOS ARM64 port (see
https://golang.org/doc/go1.16#darwin).

TestMkdirAllWithSymlink ought to run on darwin/arm64, so enable it on
that platform.

For #45696

Change-Id: I2cad6b1dfddf215e6b6cd262bbd22251f48f3d8c
Reviewed-on: https://go-review.googlesource.com/c/go/+/373359
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2022-01-02 14:27:32 +00:00
Ian Lance Taylor
6178d25fc0 misc/cgo/testsanitizers: accept compilers that don't report location
It appears that GCC before version 10 doesn't report file/line
location for asan errors.

Change-Id: I03ee24180ba365636596aa2384961df7ce6ed71f
Reviewed-on: https://go-review.googlesource.com/c/go/+/374874
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-29 20:20:32 +00:00
Ian Lance Taylor
8a306e2056 misc/cgo/testsanitizers: don't fail asan test if no symbolizer
Change-Id: Ic05c641bda3cc8f5292921c9b0c0d3df34f3bc48
Reviewed-on: https://go-review.googlesource.com/c/go/+/374794
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-12-29 19:23:11 +00:00
fanzha02
91e782106e runtime: fix the issue that the -asan option cannot print where the error occurred
The current -asan option does not print where the error occurred. The
reason is that the current implementation calls incorrect asan runtime
functions, which do not pass sp and pc where asan runtime functions are
called, and report the stack trace from the native code. But asan runtime
functions are called from cgo on a separated stack, so it cannot dump the
Go stack trace correctly.

The correct asan runtime function we should call is __asan_report_error,
which will pass sp and pc, and report where the error occurred correctly.

This patch fixes this issue.

Add the test cases.

Fixes #50362

Change-Id: I12ee1d46c7ae069ddef3d23f2fe86e112db60045
Reviewed-on: https://go-review.googlesource.com/c/go/+/374395
Trust: Fannie Zhang <Fannie.Zhang@arm.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-29 04:10:07 +00:00
Meng Zhuo
a78532a412 runtime: invalid negative frequency while tracing
The riscv64 Hifive Unmatched is the only platform that
failed on testcase TestAnalyzeAnnotations occasionally
after CL 332954 had merged. The failure happens when
ticks per second (freq) is over 1e12 which causing the timestamps
of two events are same.

There are 2 reasons causing big frequency:
1. RDCYCLE is HART based according to the riscv manual which makes
   negative ticks delta
2. negative float64 -> uint64 is undefined and "lucky" negative float
   is too big to handle for trace

For #46737

Change-Id: I1f3c1ac31aae249969000c719c32aaf5a66d29a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/373034
Trust: Zhuo Meng <mzh@golangcn.org>
Run-TryBot: Zhuo Meng <mzh@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2021-12-29 01:44:55 +00:00
Ian Lance Taylor
b357b05b70 doc/go1.18: add section for runtime/debug changes
For #37475
For #47694

Change-Id: If8c1f1b756daf32648110f1a669b2ea60f797a24
Reviewed-on: https://go-review.googlesource.com/c/go/+/373875
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-12-23 20:03:38 +00:00
Ian Lance Taylor
0e4b878258 doc/go1.18: mention debug/plan9obj.ErrNoSymbols
For #47694
For #48052

Change-Id: I136be9b498033309d876099aae16bad330555416
Reviewed-on: https://go-review.googlesource.com/c/go/+/373774
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2021-12-23 19:58:13 +00:00
Cherry Mui
af3b8cf502 cmd/go: remove MallocNanoZone environment variable workaround
We added a workaround in runtime/race. This should not be
necessary now.

Updates #49138.

Change-Id: Ia2010e4acc95c4ddf5f463ab2919401d893c0bac
Reviewed-on: https://go-review.googlesource.com/c/go/+/374314
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-23 18:58:36 +00:00
zhangjian
ed766b6ffb cmd/compile/internal/ir: fix a typo in node.go
README.md -> HACKING.md

Change-Id: I63909b86b2e6f8d9a34622f5d2b05048c79cd698
GitHub-Last-Rev: afaab8f05e
GitHub-Pull-Request: golang/go#50326
Reviewed-on: https://go-review.googlesource.com/c/go/+/374274
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-12-23 17:27:50 +00:00
Carl Johnson
d2ce939604 doc/go1.18: fix broken HTML in net/http.MaxBytesHandler
For #47694

Sorry about that! I guess the autocompleter in VSCode auto-closed the paragraph and I didn't notice.

Change-Id: I1e834e47deb708cd5285d26201a442305f8c3b24
GitHub-Last-Rev: ab88731551
GitHub-Pull-Request: golang/go#50305
Reviewed-on: https://go-review.googlesource.com/c/go/+/374014
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2021-12-22 23:31:40 +00:00
Cherry Mui
8cfcee1fff runtime: handle stray profiling signal better
In c-archive mode, when we turn off profiling, we  restore the
previous handler for SIGPROF, and ignore SIGPROF signals if no
handler was installed. So if a pending signal lands after we
remove the Go signal handler, it will not kill the program.

In the current code there is a small window, where we can still
receive signals but we are set to not handling the signal. If a
signal lands in this window (possibly on another thread), it will
see that we are not handling this signal and no previous handler
installed, and kill the program. To avoid this race, we set the
previous handler to SIG_IGN (ignoring the signal) when turning on
profiling. So when turning off profiling we'll ignore the signal
even if a stray signal lands in the small window.

Fixes #43828.

Change-Id: I304bc85a93ca0e63b0c0d8e902b097bfdc8e3f1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/374074
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-22 20:47:09 +00:00
Ian Lance Taylor
0f3becf62f doc/go1.18: list new net/netip and net functions and methods
For #46518
For #47694

Change-Id: I4848556674baf85ceec350645d9eddcd83f1b2e0
Reviewed-on: https://go-review.googlesource.com/c/go/+/373834
Trust: Ian Lance Taylor <iant@golang.org>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2021-12-22 18:43:55 +00:00
Ian Lance Taylor
d7b035f930 doc/go1.18: mention testing.F in testing package section
For #47694

Change-Id: I27d88d864319bd8dbabfa6675a6abf2f74c50717
Reviewed-on: https://go-review.googlesource.com/c/go/+/373914
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
Trust: Katie Hockman <katie@golang.org>
2021-12-22 18:38:41 +00:00
Ian Lance Taylor
90fb5a4f97 doc/go1.18: document {text,html}/template {break,continue} commands
For #20531
For #47694

Change-Id: Iaefaa0a8982eabf59cd6a53120c8af9124d60d1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/373915
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-12-22 00:11:21 +00:00
Carl Johnson
ebac50e9ce doc/go1.18: add net/http.MaxBytesHandler
For #47694

Change-Id: Ifab2c2720ec2ccef175a0e14a95f8df0437eb009
GitHub-Last-Rev: f3c2f12c7b
GitHub-Pull-Request: golang/go#50250
Reviewed-on: https://go-review.googlesource.com/c/go/+/373015
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-12-21 23:09:59 +00:00
Tobias Klauser
3fb17cfd17 os: enable TestPipeThreads on FreeBSD
This test works on FreeBSD since CL 165801 was submitted.

Updates #19093

Change-Id: I45ffeb403c1de4385cdb21b9647f21976061e1ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/373358
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-21 22:43:13 +00:00
Ian Lance Taylor
60f2c12a85 doc/go1.18: mention new go/types/Config.Context field
For #47694
For #47916

Change-Id: Ieeffaf161da744adfdb4da8aac58a64c109ebcab
Reviewed-on: https://go-review.googlesource.com/c/go/+/373775
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-12-21 22:26:48 +00:00
Filippo Valsorda
a1ce5503c7 all: update vendored golang.org/x/crypto for cryptobyte fix
Fixes #49678

Change-Id: I47dd959a787180a67856e60dfa6eba3ddd045972
Reviewed-on: https://go-review.googlesource.com/c/go/+/373360
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Filippo Valsorda <filippo@golang.org>
2021-12-21 19:17:52 +00:00
Ian Lance Taylor
9502339561 doc/go1.18: mention new debug/elf.R_PPC64_RELATIVE constant
For #47694

Change-Id: I9f4838100741d3ba13e9374e70466fa405c6e4d2
Reviewed-on: https://go-review.googlesource.com/c/go/+/372634
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-12-21 18:43:00 +00:00
Ian Lance Taylor
cfb0cc3552 cmd/link: use SHT_INIT_ARRAY for .init_array section
Fixes #50295

Change-Id: If55ebcd5f2af724da7c9c744458a56d21a7ddde7
Reviewed-on: https://go-review.googlesource.com/c/go/+/373734
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-12-21 18:34:03 +00:00
Jing维
2d1d548081 reflect: update relative path in comment
Fix it to avoid misunderstanding.

Change-Id: I2a09cb9edfa8077c5c0c35e07000c0c7dc72755e
GitHub-Last-Rev: ae49d512eb
GitHub-Pull-Request: golang/go#50260
Reviewed-on: https://go-review.googlesource.com/c/go/+/373334
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-12-21 03:55:43 +00:00
Reilly Watson
b5e06545b3 net/http: fix link to ResponseWriter trailer example
The links to this example were using an underscore separator
instead of a hyphen, and incorrect casing.

Fixes #50279

Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
Reviewed-on: https://go-review.googlesource.com/c/go/+/373514
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-12-21 03:54:36 +00:00
“kinggo”
4dfbb89f58 runtime: typo fix cyle -> cycle
Change-Id: I213fa8aa9b9c2537a189677394ddd30c62312518
GitHub-Last-Rev: ccafdee944
GitHub-Pull-Request: golang/go#50268
Reviewed-on: https://go-review.googlesource.com/c/go/+/373336
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Zhuo Meng <mzh@golangcn.org>
2021-12-21 01:51:23 +00:00
Cherry Mui
e087949090 runtime: check the correct environment variable in TestCgoCallbackGC
The test checks RUNTIME_TESTING_SHORT, whereas the test runner
actually set RUNTIME_TEST_SHORT. Check the correct one.

Updates #32023.

Change-Id: Ie8ab00e1f5b8c02112a9aa1ee0e56028185c8a44
Reviewed-on: https://go-review.googlesource.com/c/go/+/373614
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-21 01:10:17 +00:00
Andrew LeFevre
15550625c3 net/netip: add a fuzz test
This is a pretty straight port of the fuzz test at https://github.com/inetaf/netaddr.

The MarshalText methods of netip.Addr and net.IP, the Is* methods of netip.Addr
and net.IP and the MarshalText and String methods of netip.Addr are also
checked to ensure that they behave the same way.

Fixes #49367

Change-Id: I44abb01f2a7af45f39597992a1fc7ff0305728fa
GitHub-Last-Rev: c2323b0ae1
GitHub-Pull-Request: golang/go#50108
Reviewed-on: https://go-review.googlesource.com/c/go/+/371055
Trust: Matt Layher <mdlayher@gmail.com>
Trust: Katie Hockman <katie@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
2021-12-20 23:46:23 +00:00
Ian Lance Taylor
6713b5dbbc cmd/doc: don't log on constraint type elements
Fixes #50256

Change-Id: I2327a0b28f8173c801ed2946bec8083967667027
Reviewed-on: https://go-review.googlesource.com/c/go/+/373314
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-12-20 23:32:14 +00:00
Dan Kortschak
9901d9e87a all: fix spelling errors found by misspell
Change-Id: Icedd0c3d49259d5aee249ecb33374e9b78e0c275
Reviewed-on: https://go-review.googlesource.com/c/go/+/373376
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-20 23:30:58 +00:00
Cherry Mui
59d04d104d cmd/internal/obj/riscv: mark stack bounds check prologue nonpreemptible
This is similar to CL 207350, for RISCV64.

May fix #50263.
Updates #35470.

Change-Id: I0d39e195e8254d65fa1aca1cdf1fc553aa8b7cba
Reviewed-on: https://go-review.googlesource.com/c/go/+/373434
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-20 23:02:08 +00:00
Robert Griesemer
7c94355b73 go/types: better error message when using comparable in union
This is a port of CL 372674 from types2 to go/types with
minor adjustments for error handling.

For #49602.

Change-Id: I726081325a2ff2d5690d11ddc8a830bbcbd8ab33
Reviewed-on: https://go-review.googlesource.com/c/go/+/372954
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-12-20 15:13:56 +00:00
Robert Griesemer
a2004de088 go/types, types2: delay "does not satisfy comparable" error until needed
Fixes #49112.

Change-Id: I8effbca7bcbb257b18fd4d3d1914fd10d4afaaae
Reviewed-on: https://go-review.googlesource.com/c/go/+/372594
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-12-20 15:13:38 +00:00
clamyang
87b2a54827 runtime: mgc.go typo fix: becuse -> because
Change-Id: I5019d5b9520e47a99a6136f615b6c9468073cc3c
GitHub-Last-Rev: 1a5392925a
GitHub-Pull-Request: golang/go#50239
Reviewed-on: https://go-review.googlesource.com/c/go/+/373055
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
2021-12-19 20:16:45 +00:00
Cherry Mui
c5fee935bb cmd/link: force eager binding when using plugins on darwin
When building/using plugins on darwin, we need to use flat
namespace so the same symbol from the main executable and the
plugin can be resolved to the same address. Apparently, when using
flat namespace the dynamic linker can hang at forkExec when
resolving a lazy binding. Work around it by forcing early bindings.

Fixes #38824.

Change-Id: I983aa0a0960b15bf3f7871382e8231ee244655f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/372798
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-17 16:05:31 +00:00
Ian Lance Taylor
529939072e doc/go1.18: document union element restriction
For #47694

Change-Id: I9af871a4a45b002e72629904011aac8f076617f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/372974
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-12-17 03:59:09 +00:00
Robert Griesemer
3c495839fe spec: describe constraint parsing ambiguity and work-around more precisely
The new description matches the implementation (CL 370774).

Also, in the section on type constraints, use "defines" instead of
"determines" because the constraint interface defines the type set
which is precisely the set of acceptable type arguments.

For #49482.

Change-Id: I6f30f49100e8ba8bec0a0f1b450f88cae54312eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/372874
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-17 03:28:06 +00:00
Robert Griesemer
2bdf34f3e8 spec: clarify that comparable cannot be a union element
For #49602.

Change-Id: I0d3ff8f087dffb3409918494147fd1dceff7514d
Reviewed-on: https://go-review.googlesource.com/c/go/+/372694
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-17 03:28:05 +00:00
Bryan C. Mills
55a25aa6ca net: lengthen arbitrary SetDeadline timeout by a few orders of magnitude
The "someTimeout" constant in the net test is “just to test that
net.Conn implementations don't explode when their SetFooDeadline
methods are called”. It was set to 10 seconds, which is short enough
that it could actually matter on some platforms.

Since the point of the constant is just to make sure methods don't
explode, we should set it to be at least a couple of orders of
magnitude longer than the test: then it is guaranteed not to have any
unintended side-effects.

Fixes #50227

Change-Id: If97ae7bef5e7f16b336d09ccc37f5ea2ea7e70b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/372796
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-17 02:00:14 +00:00
Bryan C. Mills
63077bfcf5 os/exec: skip TestContextCancel on netbsd/arm64
For #42061

Change-Id: I3b4c774ad9e375d4bfef1cfb4336c35ed30a6430
Reviewed-on: https://go-review.googlesource.com/c/go/+/372795
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-17 01:59:32 +00:00
Robert Griesemer
2e6e9df2c1 go/types, types2: use compiler error message for undefined operators
For #48712.

Change-Id: I1596fe8688f093e0e92cf5b8d5501aac8631324e
Reviewed-on: https://go-review.googlesource.com/c/go/+/372894
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-17 00:14:53 +00:00
Robert Griesemer
c3561dd346 cmd/compile/internal/types2: better error message when using comparable in union
Fixes #49602.

Change-Id: I3499f8a485a2c8ec8afc74c5ef7b20d42c943a05
Reviewed-on: https://go-review.googlesource.com/c/go/+/372674
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-17 00:14:51 +00:00
Robert Griesemer
33a1a93a92 cmd/compile/internal/syntax: fix parsing of type parameter lists
The parser cannot distinguish a type parameter list of the form

[P *T ] or
[P (T)]

where T is not a type literal from an array length specification
P*T (product) or P(T) (constant-valued function call) and thus
interprets these forms as the start of array types.

This ambiguity must be resolved explicitly by placing *T inside
an interface, adding a trailing comma, or by leaving parentheses
away where possible.

This CL adjusts the parser such that these forms are
interpreted as (the beginning) of type parameter lists
if the token after P*T or P(T) is a comma, or if T is
a type literal.

This CL also adjusts the printer to print a comma if
necessary to avoid this ambiguity, and adds additional
printer tests.

Fixes #49482

Change-Id: I36328e2a7d9439c39ba0349837c445542549e84e
Reviewed-on: https://go-review.googlesource.com/c/go/+/370774
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-17 00:14:49 +00:00
Michael Matloob
0c24038d22 cmd/go: update go work docs
Change-Id: If28cc02a5a6f9bf2c7f2550de77ca0b31c1b35ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/372494
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2021-12-16 23:52:17 +00:00
Dan Scales
1387b5e91d cmd/compile: only avoid escaping package paths for "go.shape"
We have code that intends to avoid escaping the package path for
built-in packages. But it is hard to determine which packages are
built-in from a general rule, and we really only want to avoid escaping
for the "go.shape" package (since that gives ugly shape type names). So,
fix the code to only avoid escaping the package path specifically for
the "go.shape" package.

Fixes #50200

Change-Id: Ibaedd7690b99a173007c608c5dfa783ef82b326d
Reviewed-on: https://go-review.googlesource.com/c/go/+/372934
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-12-16 22:41:31 +00:00
Andre Marianiello
b1a53ece68 cmd/go/internal/vcs: prevent Git signatures from breaking commit time parsing
When a user has showSignature=true set in their Git config and the
commit in question has a signature, the git-show command will output
information about that signature. When this happens, the logic that
tries to parsing a timestamp from the git-show output chokes on this
signature information and the build stamping fails. This change prevents
commit signature information from being displayed even if
showSignature=true, preventing this issue.

Change-Id: I98d0a6fdd1e90dd1b91e0394713b6eb286a69d1a
GitHub-Last-Rev: 610706e23e
GitHub-Pull-Request: golang/go#49790
Reviewed-on: https://go-review.googlesource.com/c/go/+/367034
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-16 22:39:00 +00:00
Bryan C. Mills
d01cd8fa1d misc/cgo/testcarchive: log command output more consistently
Also check that executables exist immediately after building them
in parallel tests.

The parallel tests in this package occasionally fail with
"no such file or directory", implying that either the build
command failed to actually write out the binary or something
concurrently deleted it.

This is purely a shot in the dark, but I'm hoping that perhaps
the stderr output from one of these commands will shed some
light on the underlying failure mode.

For #49693

Change-Id: I2e768190c56053550879b89a3ac88c027d4741dd
Reviewed-on: https://go-review.googlesource.com/c/go/+/369034
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-16 22:15:57 +00:00
Bryan C. Mills
d93677ad7e net/http/pprof: skip TestDeltaProfile on openbsd/arm
It is observed to be flaky on the only openbsd/arm builder.
Skipping on that platform until someone can investigate.

For #50218

Change-Id: Id3a6dc12b93b3cec67870d8d81bd608c4589c952
Reviewed-on: https://go-review.googlesource.com/c/go/+/372794
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-16 22:15:22 +00:00
Bryan C. Mills
ae695cd93f cmd/go: add missing cgo condition in TestScript/mod_list_compiled_concurrent
Updates #50205

Change-Id: I60d2e32c2cd84599f4a0126e4da4f1d61bd29b51
Reviewed-on: https://go-review.googlesource.com/c/go/+/372799
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-16 21:08:09 +00:00