]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
4 years ago[release-branch.go1.13] go1.13rc1 go1.13rc1
Andrew Bonventre [Wed, 21 Aug 2019 18:40:37 +0000 (14:40 -0400)]
[release-branch.go1.13] go1.13rc1

Change-Id: I2921895d336c8f63e521b5c921494917b4f42f79
Reviewed-on: https://go-review.googlesource.com/c/go/+/191157
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agoRevert "encoding/json: avoid work when unquoting strings"
Filippo Valsorda [Tue, 20 Aug 2019 21:29:04 +0000 (17:29 -0400)]
Revert "encoding/json: avoid work when unquoting strings"

This reverts CL 151157.

CL 151157 introduced a crash when decoding into ",string" fields. It
came with a moderate speedup, so at this stage of the release cycle
let's just revert it, and reapply it in Go 1.14 with the fix in CL 190659.

Also applied the test cases from CL 190659.

Updates #33728

Change-Id: Ie46e2bc15224b251888580daf6b79d5865f3878e
Reviewed-on: https://go-review.googlesource.com/c/go/+/190909
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
4 years agocmd/go: accept GOSUMDB=sum.golang.google.cn
Russ Cox [Wed, 21 Aug 2019 14:43:49 +0000 (10:43 -0400)]
cmd/go: accept GOSUMDB=sum.golang.google.cn

This CL makes the go command understand that
GOSUMDB=sum.golang.google.cn should connect
to that domain but expect to find a checksum database
signed by sum.golang.org there.

The host sum.golang.google.cn is not yet completely
configured; we hope it will be available in a few weeks.

Change-Id: Ie0fc4323f0c7084dda59bd3b45fc406717fa16d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/191137
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
4 years agodoc/go1.13: mention '-o <directory>' support for 'go build'
Bryan C. Mills [Tue, 20 Aug 2019 20:02:24 +0000 (16:02 -0400)]
doc/go1.13: mention '-o <directory>' support for 'go build'

Fixes #33720
Updates #14295

Change-Id: I9cb6e02bcaccd7971057315163d8810157d465bd
Reviewed-on: https://go-review.googlesource.com/c/go/+/190907
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agocmd/go: fix "go help build -o" docs
Filippo Valsorda [Mon, 19 Aug 2019 17:17:34 +0000 (13:17 -0400)]
cmd/go: fix "go help build -o" docs

The docs refer to "the last two paragraphs", but in fact should refer to
the first two of the previous three paragraphs. Moved up the out of place
paragraph.

Updates #14295

Change-Id: I066da7a665bc6754d246782b941af214a385017a
Reviewed-on: https://go-review.googlesource.com/c/go/+/190839
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agodoc: rewrite reference to plan9.bell-labs.com to 9p.io
Wagner Riffel [Mon, 19 Aug 2019 03:41:12 +0000 (00:41 -0300)]
doc: rewrite reference to plan9.bell-labs.com to 9p.io

Change-Id: I75619feced842b8ca509ee08e01b63258c5e87ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/190757
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agoencoding/json: fix format string in the Fuzz func
Dmitry Vyukov [Sat, 17 Aug 2019 20:22:22 +0000 (13:22 -0700)]
encoding/json: fix format string in the Fuzz func

Currently test build fails with:

$ go test -tags=gofuzz encoding/json
encoding/json/fuzz.go:36:4: Println call has possible formatting directive %s
FAIL encoding/json [build failed]

Change-Id: I23aef44a421ed0e7bcf48b74ac5a8c6768a4841b
Reviewed-on: https://go-review.googlesource.com/c/go/+/190698
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agotime: update TestSub to avoid future regressions
Joe Tsai [Fri, 16 Aug 2019 17:36:01 +0000 (10:36 -0700)]
time: update TestSub to avoid future regressions

CL 131196 optimized Time.Sub, but was reverted because
it incorrectly computed the nanoseconds in some edge cases.
This CL adds a test case to enforce the correct behavior
so that a future optimization does not break this again.

Updates #17858
Updates #33677

Change-Id: I596d8302ca6bf721cf7ca11cc6f939639fcbdd43
Reviewed-on: https://go-review.googlesource.com/c/go/+/190524
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agocmd/gofmt: update TestRewrite to avoid future regressions
Joe Tsai [Fri, 16 Aug 2019 17:42:18 +0000 (10:42 -0700)]
cmd/gofmt: update TestRewrite to avoid future regressions

CL 162337 changed go/ast to better handle block comments,
but was reverted because it introduced an off-by-one bug.
This CL adds a test case to enforce the correct behavior
so that future changes do not break this again.

Updates #18929
Updates #33538

Change-Id: I2d25c139d007f8db1091b7a48b1dd20c584e2699
Reviewed-on: https://go-review.googlesource.com/c/go/+/190523
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
4 years agoRevert "time: optimize Sub"
Joe Tsai [Fri, 16 Aug 2019 03:16:34 +0000 (03:16 +0000)]
Revert "time: optimize Sub"

This reverts commit CL 131196 because there is a bug
in the calculation of nanoseconds.

Fixes #33677

Change-Id: Ic8e94c547ee29b8aeda1b9a5cb9764dbf47b14b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/190497
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
4 years agodoc: document Go 1.12.9
Dmitri Shuralyov [Thu, 15 Aug 2019 16:57:01 +0000 (12:57 -0400)]
doc: document Go 1.12.9

Change-Id: I88b7e085fc70f9c021788d364099f5bc6b705ba8
Reviewed-on: https://go-review.googlesource.com/c/go/+/190438
Reviewed-by: Filippo Valsorda <filippo@golang.org>
4 years agodoc: document Go 1.12.8 and Go 1.11.13
Dmitri Shuralyov [Tue, 13 Aug 2019 14:27:29 +0000 (10:27 -0400)]
doc: document Go 1.12.8 and Go 1.11.13

Change-Id: I0daab6cd347e1fc0066e516f02c33f1b63e3f1a3
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/526992
Reviewed-by: Filippo Valsorda <valsorda@google.com>
(cherry picked from commit 305f6dc30cfd163aa959ec4bd2a912f7c29da5c8)
Reviewed-on: https://go-review.googlesource.com/c/go/+/190437
Reviewed-by: Filippo Valsorda <filippo@golang.org>
4 years agoreflect: align first argument in callMethod
Cherry Zhang [Wed, 14 Aug 2019 13:50:51 +0000 (09:50 -0400)]
reflect: align first argument in callMethod

When calling a function obtained from reflect.Value.Method (or
MethodByName), we copy the arguments from the caller frame, which
does not include the receiver, to a new frame to call the actual
method, which does include the receiver. Here we need to align
the first (non-receiver) argument. As the receiver is pointer
sized, it is generally naturally aligned, except on amd64p32,
where the argument can have larger alignment, and this aligning
becomes necessary.

Fixes #33628.

Change-Id: I5bea0e20173f06d1602c5666d4f334e3d0de5c1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/190297
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
4 years agodoc/go1.13: add missing periods
Toshihiro Shiino [Wed, 14 Aug 2019 05:26:56 +0000 (05:26 +0000)]
doc/go1.13: add missing periods

Change-Id: If9ad650174572c475f0b3d3394208c2a9dd0a596
Reviewed-on: https://go-review.googlesource.com/c/go/+/190237
Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
4 years agonet/url: make Hostname and Port predictable for invalid Host values
Filippo Valsorda [Tue, 6 Aug 2019 23:32:16 +0000 (19:32 -0400)]
net/url: make Hostname and Port predictable for invalid Host values

When Host is not valid per RFC 3986, the behavior of Hostname and Port
was wildly unpredictable, to the point that Host could have a suffix
that didn't appear in neither Hostname nor Port.

This is a security issue when applications are applying checks to Host
and expecting them to be meaningful for the contents of Hostname.

To reduce disruption, this change only aims to guarantee the following
two security-relevant invariants.

* Host is either Hostname or [Hostname] with Port empty, or
  Hostname:Port or [Hostname]:Port.

* Port is only decimals.

The second invariant is the one that's most likely to cause disruption,
but I believe it's important, as it's conceivable an application might
do a suffix check on Host and expect it to be meaningful for the
contents of Hostname (if the suffix is not a valid port).

There are three ways to ensure it.

1) Reject invalid ports in Parse. Note that non-numeric ports are
   already rejected if and only if the host starts with "[".

2) Consider non-numeric ports as part of Hostname, not Port.

3) Allow non-numeric ports, and hope they only flow down to net/http,
   which will reject them (#14353).

This change adopts both 1 and 2. We could do only the latter, but then
these invalid hosts would flow past port checks, like in
http_test.TestTransportRejectsAlphaPort. Non-numeric ports weren't fully
supported anyway, because they were rejected after IPv6 literals, so
this restores consistency. We could do only the former, but at this
point 2) is free and might help with manually constructed Host values
(or if we get something wrong in Parse).

Note that net.SplitHostPort and net.Dial explicitly accept service names
in place of port numbers, but this is an URL package, and RFC 3986,
Section 3.2.3, clearly specifies ports as a number in decimal.

net/http uses a mix of net.SplitHostPort and url.Parse that would
deserve looking into, but in general it seems that it will still accept
service names in Addr fields as they are passed to net.Listen, while
rejecting them in URLs, which feels correct.

This leaves a number of invalid URLs to reject, which however are not
security relevant once the two invariants above hold, so can be done in
Go 1.14: IPv6 literals without brackets (#31024), invalid IPv6 literals,
hostnames with invalid characters, and more.

Tested with 200M executions of go-fuzz and the following Fuzz function.

u, err := url.Parse(string(data))
if err != nil {
return 0
}
h := u.Hostname()
p := u.Port()

switch u.Host {
case h + ":" + p:
return 1
case "[" + h + "]:" + p:
return 1
case h:
fallthrough
case "[" + h + "]":
if p != "" {
panic("unexpected Port()")
}
return 1
}
panic("Host is not a variant of [Hostname]:Port")

Fixes CVE-2019-14809
Updates #29098

Change-Id: I7ef40823dab28f29511329fa2d5a7fb10c3ec895
Reviewed-on: https://go-review.googlesource.com/c/go/+/189258
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agosrc/go.mod: sync golang.org/x/net with h2_bundle.go
Filippo Valsorda [Sun, 11 Aug 2019 18:34:32 +0000 (14:34 -0400)]
src/go.mod: sync golang.org/x/net with h2_bundle.go

The bundle included changes from a commit after the one referred to by
the go.mod, probably due to cmd/bundle using the GOPATH source.

Identified with the new go/packages based cmd/bundle from CL 189818.

$ go get golang.org/x/net@461777fb6f
$ go mod tidy
$ go mod vendor
$ go generate net/http # with CL 189818

Also, updated the socks_bundle.go generate command to drop obsolete
options and match h2_bundle.go. It caused no output changes.

Updates #32031

Change-Id: I0322d4e842dbfdad749455111072ca4872a62ad4
Reviewed-on: https://go-review.googlesource.com/c/go/+/189897
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agonet: document that a keep-alive failure also returns a timeout
Ian Lance Taylor [Fri, 9 Aug 2019 20:48:34 +0000 (13:48 -0700)]
net: document that a keep-alive failure also returns a timeout

Updates #31449

Change-Id: I76490c5e83eb2f7ba529b387a57ba088428aece5
Reviewed-on: https://go-review.googlesource.com/c/go/+/189757
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
4 years agodoc/asm: document go_asm.h only works in the runtime package
Pure White [Sun, 11 Aug 2019 05:37:29 +0000 (05:37 +0000)]
doc/asm: document go_asm.h only works in the runtime package

Fixes #33054

Change-Id: I687d45e092d721a6c22888cc7ddbe420c16a5af9
GitHub-Last-Rev: a7208c89a0d613a53ab057e0b4418ae4719cfcbd
GitHub-Pull-Request: golang/go#33069
Reviewed-on: https://go-review.googlesource.com/c/go/+/185917
Reviewed-by: Rob Pike <r@golang.org>
4 years agodoc/go1.13: mention faster sync.Mutex/RWMutex/Once
Carlo Alberto Ferraris [Sat, 10 Aug 2019 13:11:26 +0000 (13:11 +0000)]
doc/go1.13: mention faster sync.Mutex/RWMutex/Once

Mention faster sync.Mutex/RWMutex/Once in the 1.13 release notes.

Change-Id: I29d8a5004a0af42542e8db82a8c9e2e06a15dbb0
GitHub-Last-Rev: 2995401dab563ea5af98c0f5351f51a6116f105e
GitHub-Pull-Request: golang/go#33404
Reviewed-on: https://go-review.googlesource.com/c/go/+/188479
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
4 years agodoc/install-source: create distinction between steps that involve "git clone"
K. "pestophagous" Heller [Mon, 5 Aug 2019 05:46:29 +0000 (22:46 -0700)]
doc/install-source: create distinction between steps that involve "git clone"

Prior doc implied that "git clone" was one way to obtain a go1.4
bootstrap toochain, but it did not state this outright. Further,
the doc did not make it explicit in the "Fetch the repository"
section that one must necessarily "git clone" a second time in
the (presumed-to-be-uncommon) case where "git clone" had already
been perfomed in the "compiler binaries" section.

Updates #33402

Change-Id: Id70a6587b6ee09aca13559d63868b75cb07dff1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/188900
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agocmd/link: increase the function call limit in stkcheck
Ian Lance Taylor [Fri, 9 Aug 2019 17:54:43 +0000 (10:54 -0700)]
cmd/link: increase the function call limit in stkcheck

There is real (albeit generated) code that exceeds the limit.

Fixes #33555

Change-Id: I668e85825d3d2a471970e869abe63f3492213cc1
Reviewed-on: https://go-review.googlesource.com/c/go/+/189697
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
4 years agodoc/install-source.html: add new GOOS and GOARCHes
Agniva De Sarker [Fri, 9 Aug 2019 09:07:39 +0000 (14:37 +0530)]
doc/install-source.html: add new GOOS and GOARCHes

And also insert new paragraphs between GOOS and GOARCH listings
for better readability.

Fixes #28142
Fixes #26513

Change-Id: Ie92e98dbfd924e80032a12afbfa02f30e3a6f916
Reviewed-on: https://go-review.googlesource.com/c/go/+/189578
Reviewed-by: Andrew Bonventre <andybons@golang.org>
4 years agocmd/go: query each path only once in 'go get'
Bryan C. Mills [Thu, 8 Aug 2019 22:09:54 +0000 (18:09 -0400)]
cmd/go: query each path only once in 'go get'

If we don't know whether a path is a module path or a package path,
previously we would first try a module query for it, then fall back to
a package query.

If we are using a sequence of proxies with fallback (as will be the
default in Go 1.13), and the path is not actually a module path, that
initial module query will fail against the first proxy, then
immediately fall back to the next proxy in the sequence — even if the
query could have been satisfied by some other (prefix) module
available from the first proxy.

Instead, we now query the requested path as only one kind of path.
If we query it as a package path but it turns out to only exist as a
module, we can detect that as a PackageNotInModuleError with an
appropriate module path — we do not need to issue a second query to
classify it.

Fixes #31785

Change-Id: I581d44279196e41d1fed27ec25489e75d62654e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/189517
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agocmd/go: improve 'go mod download' and 'go list -m' error messages
Jay Conrod [Wed, 7 Aug 2019 20:27:39 +0000 (16:27 -0400)]
cmd/go: improve 'go mod download' and 'go list -m' error messages

modload.ListModules now wraps errors as module.ModuleError as
appropriate. The resulting errors always include the module path and
will include the version, if known.

'go mod download' no longer ignores errors reported by ListModules.
Previously, it started requesting module info, go.mod, and zip. Those
requests would fail, overwriting the original failure. They were
usually less descriptive.

'go mod download' with a module not in the build list (and no version
query) is now an error. Previously, this was silently ignored.

Fixes #30743

Change-Id: Icee8c1c6c5240de135a8b6ba42d6bbcdb757cdac
Reviewed-on: https://go-review.googlesource.com/c/go/+/189323
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agoRevert "go/ast: fix SortImports to handle block comments"
Joe Tsai [Thu, 8 Aug 2019 06:01:24 +0000 (06:01 +0000)]
Revert "go/ast: fix SortImports to handle block comments"

This reverts CL 162337.

Reason for revert: this introduces a regression

Fixes #33538
Updates #18929

Change-Id: Ib2320a840c6d3ec7912e8f414e933d04fbf11ab4
Reviewed-on: https://go-review.googlesource.com/c/go/+/189379
Reviewed-by: Robert Griesemer <gri@golang.org>
4 years agoapi/go1.13: add debug/elf.Symbol fields added in CL 184099
Filippo Valsorda [Thu, 8 Aug 2019 18:08:48 +0000 (14:08 -0400)]
api/go1.13: add debug/elf.Symbol fields added in CL 184099

These will need auditing per #32813 like a few others in go1.13.txt, but
in the meantime they break the API check for beta/RC releases.

Updates #32813
Updates #31912

Change-Id: I3b0501b46324ee6fc0985f84971b99b772c7e4a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/189458
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
4 years agodoc: update list of archs supporting -race
Alberto Donizetti [Wed, 7 Aug 2019 18:11:46 +0000 (20:11 +0200)]
doc: update list of archs supporting -race

Change-Id: Id0a55674a16671aaee99182d9096a9263f7a80b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/189357
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agopath: fix mismatch between error message and corresponding test function
Derek Phan [Wed, 7 Aug 2019 23:42:03 +0000 (23:42 +0000)]
path: fix mismatch between error message and corresponding test function

Change-Id: Ib0ae6e3e678dc7ace21b891e946ffc6bc2a78835
GitHub-Last-Rev: 8c6704ea8c032072ac339dc9d1c6ec78aec15b2a
GitHub-Pull-Request: golang/go#33534
Reviewed-on: https://go-review.googlesource.com/c/go/+/189378
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agoruntime/pprof: Mention goroutine label heritability
David Finkel [Wed, 31 Jul 2019 13:10:28 +0000 (09:10 -0400)]
runtime/pprof: Mention goroutine label heritability

Document goroutine label inheritance. Goroutine labels are copied upon
goroutine creation and there is a test enforcing this, but it was not
mentioned in the docstrings for `Do` or `SetGoroutineLabels`.

Add notes to both of those functions' docstrings so it's clear that one
does not need to set labels as soon as a new goroutine is spawned if
they want to propagate tags.

Updates #32223
Updates #23458

Change-Id: Idfa33031af0104b884b03ca855ac82b98500c8b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/189317
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agocmd/go: improve error message for missing import starting with cmd/
Jay Conrod [Tue, 6 Aug 2019 16:44:30 +0000 (12:44 -0400)]
cmd/go: improve error message for missing import starting with cmd/

In modload.Import, confirm that the import path does not start with
"cmd/" before calling QueryPackage, which returns a less helpful
error.

In load.loadPackageData, don't wrap errors with "unknown import path".
The wrapped error should always include the import path, and it's also
repeated in the PackageError wrapper.

Fixes #31031

Change-Id: I071efa22e3842c62831d096f888a8006811fe724
Reviewed-on: https://go-review.googlesource.com/c/go/+/189157
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agodoc: mention Unicode update in release notes
Marcel van Lohuizen [Mon, 5 Aug 2019 15:57:29 +0000 (17:57 +0200)]
doc: mention Unicode update in release notes

Fixes #33472

Change-Id: Iab69e69589f2e017f4cf9770858884b1a570c89e
Reviewed-on: https://go-review.googlesource.com/c/go/+/188799
Reviewed-by: Andrew Bonventre <andybons@golang.org>
4 years agocmd/go: look for __go_buildinfo section when looking for Mach-O version
Jay Conrod [Tue, 6 Aug 2019 17:12:23 +0000 (13:12 -0400)]
cmd/go: look for __go_buildinfo section when looking for Mach-O version

This mirrors the ELF fix in CL 188957. TestScript/version failed on
darwin after that change.

Fixes #31861

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

4 years agonet: fix the docs in IPNet.String
Bharath Thiruveedula [Tue, 6 Aug 2019 03:56:48 +0000 (09:26 +0530)]
net: fix the docs in IPNet.String

Fixes #33433
Change-Id: Idb3961685a3cfd13ba26155a1d64fc24cc418fdb
Reviewed-on: https://go-review.googlesource.com/c/go/+/189117
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agoerrors: improve doc
Jonathan Amsterdam [Fri, 2 Aug 2019 10:43:20 +0000 (06:43 -0400)]
errors: improve doc

Explain wrapping and how to use Is and As in the package doc.

Explain "chain" in Is and As.

Updates #33364.

Change-Id: Ic06362106dbd129e33dd47e63176ee5355492086
Reviewed-on: https://go-review.googlesource.com/c/go/+/188737
Reviewed-by: Rob Pike <r@golang.org>
4 years agodoc/go1.13.html: describe error-value additions
Jonathan Amsterdam [Mon, 5 Aug 2019 14:14:40 +0000 (10:14 -0400)]
doc/go1.13.html: describe error-value additions

A brief description at the top the Standard Library section of the
changes to support error wrapping.

Fixes #33365.

Change-Id: Id5a3b2fe148d9bfb949f2cfc9e5d8a1613a0e219
Reviewed-on: https://go-review.googlesource.com/c/go/+/188798
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agosyscall: include complete prototype of system calls
Keith Randall [Mon, 29 Jul 2019 21:41:00 +0000 (14:41 -0700)]
syscall: include complete prototype of system calls

The prototypes were truncated because they were on multiple lines
of the source file.

Copied from the STD lines for these functions in
https://svn.freebsd.org/base/stable/12/sys/kern/syscalls.master

Change-Id: I618a5444f1353aabee2758c06f86ad726185d19c
Reviewed-on: https://go-review.googlesource.com/c/go/+/188077
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
4 years agocmd/go: adjust expected error message in TestScript/mod_invalid_version
Bryan C. Mills [Mon, 5 Aug 2019 16:29:51 +0000 (12:29 -0400)]
cmd/go: adjust expected error message in TestScript/mod_invalid_version

CL 188817 improved the error message for a nonexistent version in a dependency.
This CL locks in that improvement in a regression test.

Fixes #33474

Change-Id: I6246b4995adee966f24eaebe491d35830aea8370
Reviewed-on: https://go-review.googlesource.com/c/go/+/188977
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
4 years agocmd/go: look for .go.buildinfo section when looking for ELF version
Mark Glines [Wed, 31 Jul 2019 03:46:15 +0000 (03:46 +0000)]
cmd/go: look for .go.buildinfo section when looking for ELF version

Based on original fix from Mark Glines in golang.org/cl/186737

Fixes #31861

Change-Id: Ibd583a3aa8f8b8eefade998aa2ac757b55140937
Reviewed-on: https://go-review.googlesource.com/c/go/+/188957
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agonet/http: fix typo in Response.Body's doc
Shivani Singhal [Sun, 4 Aug 2019 07:17:55 +0000 (12:47 +0530)]
net/http: fix typo in Response.Body's doc

Fixes #33453.

Change-Id: If0aa48f953633690884ddcff033b3be6d1d66443
Reviewed-on: https://go-review.googlesource.com/c/go/+/188541
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
4 years agodoc/go1.13: add release notes for GOWASM environment variable
Agniva De Sarker [Fri, 2 Aug 2019 16:28:29 +0000 (21:58 +0530)]
doc/go1.13: add release notes for GOWASM environment variable

Change-Id: I103a21ae0be8feb9447fa277483b7c2a8b5807e7
Reviewed-on: https://go-review.googlesource.com/c/go/+/188540
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Richard Musiol <neelance@gmail.com>
4 years agoos: change Readdirnames doc to follow that of Readdir
Ian Lance Taylor [Tue, 30 Jul 2019 13:28:57 +0000 (06:28 -0700)]
os: change Readdirnames doc to follow that of Readdir

The two methods act the same, so make their documentation similar so
that people don't think they act differently.

Change-Id: If224692ef50870faf855d789380a614d1e724132
Reviewed-on: https://go-review.googlesource.com/c/go/+/188137
Reviewed-by: Rob Pike <r@golang.org>
4 years agoos: don't consult Is methods on non-syscall error types
Damien Neil [Fri, 2 Aug 2019 18:18:56 +0000 (11:18 -0700)]
os: don't consult Is methods on non-syscall error types

CL #163058 moves interpretation of platform-specific errors to the
syscall package. Package syscall errors implement an Is method which
os.IsPermission etc. consult. This results in an unintended semantic
change to the os package predicate functions: The following program
now prints 'true' where it used to print 'false':

package main
import "os"
type myError struct{ error }
func (e myError) Is(target error) bool { return target == os.ErrPermission }
func main() { println(os.IsPermission(myError{})) }

Change the os package error predicate functions to only examine syscall
errors, avoiding this semantic change.

This CL does retain one minor semantic change: On Plan9, os.IsPermission
used to return true for any error with text containing the string
"permission denied". It now only returns true for a syscall.ErrorString
containing that text.

Change-Id: I6b512b1de6ced46c2f1cc8d264fa2495ae7bf9f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/188817
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
4 years agodoc/go1.13: mention confusion between keep-alive timeout and deadline
Ian Lance Taylor [Fri, 2 Aug 2019 20:17:59 +0000 (13:17 -0700)]
doc/go1.13: mention confusion between keep-alive timeout and deadline

Updates #31449

Change-Id: I4d7075b20cd8171bc792e40b388f4215264a3317
Reviewed-on: https://go-review.googlesource.com/c/go/+/188819
Reviewed-by: Filippo Valsorda <filippo@golang.org>
4 years agocmd/go: report loading errors from 'go mod tidy' and 'go mod vendor'
Bryan C. Mills [Fri, 2 Aug 2019 20:24:45 +0000 (16:24 -0400)]
cmd/go: report loading errors from 'go mod tidy' and 'go mod vendor'

Fixes #27063

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

4 years agocmd/compile: fix crash on write barrier insertion
Keith Randall [Fri, 2 Aug 2019 17:36:03 +0000 (10:36 -0700)]
cmd/compile: fix crash on write barrier insertion

The compiler can crash if the compiled code tries to
unconditionally read from a nil pointer. This should cause
the generated binary to panic, not the compiler.

Fixes #33438

Change-Id: Ic8fa89646d6968e2cc4e27da0ad9286662f8bc49
Reviewed-on: https://go-review.googlesource.com/c/go/+/188760
Reviewed-by: Austin Clements <austin@google.com>
4 years agodoc/go1.13: document net/http.Transport.Request.Body unfurling
Emmanuel T Odeke [Thu, 1 Aug 2019 01:14:56 +0000 (18:14 -0700)]
doc/go1.13: document net/http.Transport.Request.Body unfurling

Documents the work from:
* CL 163599
* CL 163737

which now uses the Request.Body's io.ReaderFrom implementation,
if available, and permits system level optimizations such as
"sendfile" to be used to transmit/upload the Body, which greatly
speeds up file uploads.

Updates #33396

Change-Id: I7b8315c4b3e57ad47bb9be2b0c838857875d4bd5
Reviewed-on: https://go-review.googlesource.com/c/go/+/188457
Reviewed-by: Andrew Bonventre <andybons@golang.org>
4 years agoall: remove os.ErrTimeout
Damien Neil [Fri, 2 Aug 2019 16:09:27 +0000 (09:09 -0700)]
all: remove os.ErrTimeout

It is unclear whether the current definition of os.IsTimeout is
desirable or not. Drop ErrTimeout for now so we can consider adding it
(or some other error) in a future release with a corrected definition.

Fixes #33411

Change-Id: I8b880da7d22afc343a08339eb5f0efd1075ecafe
Reviewed-on: https://go-review.googlesource.com/c/go/+/188758
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agodoc: fix Block interface parameters order
Alberto Donizetti [Fri, 2 Aug 2019 17:09:20 +0000 (19:09 +0200)]
doc: fix Block interface parameters order

The Effective Go document references the crypto/cipher Block
interface, but the parameters' names are swapped. This change
alignes them to the crypto definition, to avoid confusion.

Fixes #33432

Change-Id: I8b9aac4dc6af3eec968bbc8f3ee5366b99016fcc
Reviewed-on: https://go-review.googlesource.com/c/go/+/188797
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agoos: enable the close-on-exec flag for openFdAt
Baokun Lee [Thu, 1 Aug 2019 16:31:57 +0000 (00:31 +0800)]
os: enable the close-on-exec flag for openFdAt

There's a race here with fork/exec, enable the close-on-exec flag
for the new file descriptor.

Fixes #33405

Change-Id: If95bae97a52b7026a930bb3427e47bae3b0032ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/188537
Run-TryBot: Baokun Lee <nototon@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agonet/http: fix a typo in spelling of MultiPartForm
Darren McCleary [Thu, 1 Aug 2019 20:34:29 +0000 (20:34 +0000)]
net/http: fix a typo in spelling of MultiPartForm

Change-Id: I33a5313ef10e8c88d9c12507573b385fa0843afe
GitHub-Last-Rev: 844d4351583e3f2e94d6420dcd50d50845d1b4cb
GitHub-Pull-Request: golang/go#33412
Reviewed-on: https://go-review.googlesource.com/c/go/+/188498
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
4 years agodoc/go1.13: add more release notes for net/http
Emmanuel T Odeke [Thu, 1 Aug 2019 02:18:32 +0000 (19:18 -0700)]
doc/go1.13: add more release notes for net/http

Fixes #33396

Change-Id: Id975a23b8d6555a3f19ef283fccbbe122f10acfe
Reviewed-on: https://go-review.googlesource.com/c/go/+/188477
Reviewed-by: Andrew Bonventre <andybons@golang.org>
4 years agoall: remove os.ErrTemporary
Damien Neil [Wed, 31 Jul 2019 20:13:39 +0000 (13:13 -0700)]
all: remove os.ErrTemporary

As discussed in
https://github.com/golang/go/issues/32463#issuecomment-506833421
the classification of deadline-based timeouts as "temporary" errors is a
historical accident. I/O timeouts used to be duration-based, so they
really were temporary--retrying a timed-out operation could succeed. Now
that they're deadline-based, timeouts aren't temporary unless you reset
the deadline.

Drop ErrTemporary from Go 1.13, since its definition is wrong. We'll
consider putting it back in Go 1.14 with a clear definition and
deprecate net.OpError.Temporary.

Fixes #32463

Change-Id: I70cda664590d8872541e17409a5780da76920891
Reviewed-on: https://go-review.googlesource.com/c/go/+/188398
Reviewed-by: Jonathan Amsterdam <jba@google.com>
4 years agocmd/compile: don't eliminate all registers when restricting to desired ones
Keith Randall [Tue, 30 Jul 2019 23:14:20 +0000 (16:14 -0700)]
cmd/compile: don't eliminate all registers when restricting to desired ones

We shouldn't mask to desired registers if we haven't masked out all the
forbidden registers yet.  In this path we haven't masked out the nospill
registers yet. If the resulting mask contains only nospill registers, then
allocReg fails.

This can only happen on resultNotInArgs-marked instructions, which exist
only on the ARM64, MIPS, MIPS64, and PPC64 ports.

Maybe there's a better way to handle resultNotInArgs instructions.
But for 1.13, this is a low-risk fix.

Fixes #33355

Change-Id: I1082f78f798d1371bde65c58cc265540480e4fa4
Reviewed-on: https://go-review.googlesource.com/c/go/+/188178
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
4 years agocmd/go: only pass -fsplit-stack to gccgo if supported
Ian Lance Taylor [Sat, 27 Jul 2019 23:14:16 +0000 (16:14 -0700)]
cmd/go: only pass -fsplit-stack to gccgo if supported

Also add other gccgo options.

This ports CL 45695 and CL 48592 from the gofrontend repo to the gc repo.

CL 45695 (partial entry, other parts out of date and not ported):

    cmd/go: gccgo: consistent results

    Pass the -fdebug-prefix-map and -gno-record-gcc-switches compiler
    options to gccgo to generate consistent results.

CL 48592:

    cmd/go: use gccSupportsFlag for -fsplit-stack

    Don't assume that all (or only) 386/amd64 compilers support
    -fsplit-stack.

Fixes #33108

Change-Id: I61f9e5a67e4fb059f26750e97621d27afa566ec2
Reviewed-on: https://go-review.googlesource.com/c/go/+/187824
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agoencoding/json: clarify Marshal behavior for string keys of maps
Eli Bendersky [Wed, 31 Jul 2019 20:42:16 +0000 (13:42 -0700)]
encoding/json: clarify Marshal behavior for string keys of maps

This is a documentation-only change.

Fixes #28827

Change-Id: Ife9ab997809048784f35872b09905bc209a05eff
Reviewed-on: https://go-review.googlesource.com/c/go/+/188417
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agodoc/go1.12: document change in syscall.Setrlimit behavior
Andrew Bonventre [Tue, 30 Jul 2019 21:46:36 +0000 (17:46 -0400)]
doc/go1.12: document change in syscall.Setrlimit behavior

Fixes #30401

Change-Id: I7b5035ffc7333c746d4e31563df26ff4f934dfc6
Reviewed-on: https://go-review.googlesource.com/c/go/+/188237
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
4 years agonet/http: return nil from Header.Clone if the receiver is nil
Andrew Bonventre [Tue, 30 Jul 2019 21:03:16 +0000 (17:03 -0400)]
net/http: return nil from Header.Clone if the receiver is nil

Fixes #33141

Change-Id: I84a8b3496fc9396fd1c09ba9505697c34bdf7105
Reviewed-on: https://go-review.googlesource.com/c/go/+/188022
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agospec: add an example of a trivially invalid interface
Robert Griesemer [Tue, 30 Jul 2019 23:16:03 +0000 (16:16 -0700)]
spec: add an example of a trivially invalid interface

In preparation for the forthcoming spec changes for #6977.
While at it, modernize existing File example that dates
back all the way to commit 18c5b488a3b.

Change-Id: Id10e4df0513e3de15bd58867222923eefa9473ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/187978
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agonet/http: improve Request.Form and Request.PostForm documentation
David Ndungu [Sat, 27 Jul 2019 20:56:22 +0000 (13:56 -0700)]
net/http: improve Request.Form and Request.PostForm documentation

Request.PostForm gets populated with form data for PATCH, POST, or PUT
http verbs.

Change-Id: I33065aa78a8470c4e9490aac830aa6f5963c61cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/187821
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
4 years agocmd/go/internal/cache: verify that timestamp is positive
Bryan C. Mills [Tue, 30 Jul 2019 18:51:26 +0000 (14:51 -0400)]
cmd/go/internal/cache: verify that timestamp is positive

An apparent typo caused us to re-check size instead.

Updates #29667

Change-Id: Icc1fb9cef1ba77b8490c8fbe6c343be06ff48d8d
Reviewed-on: https://go-review.googlesource.com/c/go/+/188020
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agocmd/go/internal/cache: avoid ioutil.WriteFile for writing cache entries
Bryan C. Mills [Fri, 26 Jul 2019 00:26:46 +0000 (20:26 -0400)]
cmd/go/internal/cache: avoid ioutil.WriteFile for writing cache entries

ioutil.WriteFile always truncates the destination file to 0 before
writing, which is inappropriate for unsynchronized, idempotent,
fixed-size files such as the cache entry files here.

Instead, truncate the file only after writing it, so that a second
write will never (even temporarily!) remove the contents of a
preceding write.

Fixes #29667

Change-Id: I16a53ce79d8a23d23580511cb6abd062f54b65ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/188157
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agoruntime: call sysHugePage less often
Michael Knyszek [Fri, 19 Jul 2019 23:35:24 +0000 (19:35 -0400)]
runtime: call sysHugePage less often

Currently when we coalesce memory we make a sysHugePage call
(MADV_HUGEPAGE) to ensure freed and coalesced huge pages are treated as
such so the scavenger's assumptions about performance are more in line
with reality.

Unfortunately we do it way too often because we do it if there was any
change to the huge page count for the span we're coalescing into, not
taking into account that it could coalesce with its neighbors and not
actually create a new huge page.

This change makes it so that it only calls sysHugePage if the original
huge page counts between the span to be coalesced into and its neighbors
do not add up (i.e. a new huge page was created due to alignment). Calls
to sysHugePage will now happen much less frequently, as intended.

Updates #32828.

Change-Id: Ia175919cb79b730a658250425f97189e27d7fda3
Reviewed-on: https://go-review.googlesource.com/c/go/+/186926
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
4 years agoruntime: add physHugePageShift
Michael Anthony Knyszek [Tue, 16 Jul 2019 20:36:33 +0000 (20:36 +0000)]
runtime: add physHugePageShift

This change adds physHugePageShift which is defined such that
1 << physHugePageShift == physHugePageSize. The purpose of this variable
is to avoid doing expensive divisions in key functions, such as
(*mspan).hugePages.

This change also does a sweep of any place we might do a division or mod
operation with physHugePageSize and turns it into bit shifts and other
bitwise operations.

Finally, this change adds a check to mallocinit which ensures that
physHugePageSize is always a power of two. osinit might choose to ignore
non-powers-of-two for the value and replace it with zero, but mallocinit
will fail if it's not a power of two (or zero). It also derives
physHugePageShift from physHugePageSize.

This change helps improve the performance of most applications because
of how often (*mspan).hugePages is called.

Updates #32828.

Change-Id: I1a6db113d52d563f59ae8fd4f0e130858859e68f
Reviewed-on: https://go-review.googlesource.com/c/go/+/186598
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
4 years agostrings: clarify usage of Title and ToTitle
Andrew Todd [Sat, 27 Jul 2019 23:20:49 +0000 (16:20 -0700)]
strings: clarify usage of Title and ToTitle

This is intended to help clear up confusion around the usage of the
Title and ToTitle functions. It includes a link to define title case
to distinguish it from upper case. It also includes an additional
example for the ToTitle function to showcase the difference in behavior
between it and the Title function.

Fixes #33302

Change-Id: I44e62962fb04d0d22966a39eda3a2d16de7a2291
Reviewed-on: https://go-review.googlesource.com/c/go/+/187825
Reviewed-by: Rob Pike <r@golang.org>
4 years agoruntime: use uintptr instead of int32 for counting to next heap profile sample
Keith Randall [Mon, 29 Jul 2019 19:51:19 +0000 (12:51 -0700)]
runtime: use uintptr instead of int32 for counting to next heap profile sample

Overflow of the comparison caused very large (>=1<<32) allocations to
sometimes not get sampled at all. Use uintptr so the comparison will
never overflow.

Fixes #33342

Tested on the example in 33342. I don't want to check a test in that
needs that much memory, however.

Change-Id: I51fe77a9117affed8094da93c0bc5f445ac2d3d3
Reviewed-on: https://go-review.googlesource.com/c/go/+/188017
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
4 years agogo1.13.html: release note for %w
Jonathan Amsterdam [Sat, 27 Jul 2019 18:29:02 +0000 (14:29 -0400)]
go1.13.html: release note for %w

Also, reorder packages so the list is in alphabetical order.

Fixes #32914.

Change-Id: Ifa504cb7e48df31ba6dc0e5756148430b59fa139
Reviewed-on: https://go-review.googlesource.com/c/go/+/187797
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
4 years agocrypto/x509: add Ed25519 to ExampleParsePKIXPublicKey
Filippo Valsorda [Thu, 20 Jun 2019 19:48:29 +0000 (15:48 -0400)]
crypto/x509: add Ed25519 to ExampleParsePKIXPublicKey

ParsePKIXPublicKey gained Ed25519 support in CL 175478.

Change-Id: I11ffe0a62743292367b3adb103956e61bad57cc4
Reviewed-on: https://go-review.googlesource.com/c/go/+/183243
Reviewed-by: Katie Hockman <katie@golang.org>
4 years agoall: change some function documentation to be more idiomatic
Dominik Honnef [Sun, 28 Jul 2019 14:30:35 +0000 (16:30 +0200)]
all: change some function documentation to be more idiomatic

Change-Id: I932de9bb061a8ba3332ef03207983e8b98d6f1e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/187918
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agodoc: use <code> for a few file paths that didn't
Daniel Martí [Sat, 27 Jul 2019 21:53:54 +0000 (14:53 -0700)]
doc: use <code> for a few file paths that didn't

Spotted while seeing CL 187818 in master.

Change-Id: Ic3f42558f6833fc35580b2b2a15f2c5aba5713c0
Reviewed-on: https://go-review.googlesource.com/c/go/+/187822
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agodoc: mention that GOPATH/bin should be in PATH
Giovanni Bajo [Sat, 27 Jul 2019 18:55:54 +0000 (11:55 -0700)]
doc: mention that GOPATH/bin should be in PATH

As noticed while mentoring at Gophercon, a common mistake for
beginners is that, after they install git-codereview, it's not
found by git because they haven't put GOPATH/bin in their
environment.

Change-Id: I885cee0f532a4069d1a17ea27365d54965ecca22
Reviewed-on: https://go-review.googlesource.com/c/go/+/187818
Reviewed-by: Katie Hockman <katie@golang.org>
4 years agoos: document File's concurrent operation resource limits
Emmanuel T Odeke [Wed, 12 Jun 2019 15:19:31 +0000 (08:19 -0700)]
os: document File's concurrent operation resource limits

Document that *os.File is subject to resource limits
for concurrent operations. We aren't documenting
a specific number of concurrent operations because that
number is OS/system dependent. This limit comes from:
    internal/poll/fd_mutex.go
where we use 20 bits to count locks.

Fixes #32544

Change-Id: I7d305d4aaba5b2dbc6f1ab8c447117fde5e31a66
Reviewed-on: https://go-review.googlesource.com/c/go/+/181841
Reviewed-by: Rob Pike <r@golang.org>
4 years agocmd/go: keep "go help" in unknown topic suggestion
Jordi Martin [Tue, 23 Jul 2019 18:27:06 +0000 (18:27 +0000)]
cmd/go: keep "go help" in unknown topic suggestion

Fixed missing concatenation to build the suggested command.

Fixes #33153

Change-Id: I26c02f2966247aa07d1447b8ec1a2203046842dd
GitHub-Last-Rev: 9631abf1d0d187cbd94495a2a789e5863b421441
GitHub-Pull-Request: golang/go#33245
Reviewed-on: https://go-review.googlesource.com/c/go/+/187217
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agotest: new testcase for gccgo compiler failure
Than McIntosh [Mon, 22 Jul 2019 13:33:15 +0000 (09:33 -0400)]
test: new testcase for gccgo compiler failure

Updates #33219

Change-Id: I1702d4c630bb891fcb8b59e775dd3f1673cd8640
Reviewed-on: https://go-review.googlesource.com/c/go/+/187057
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agocmd/go: mention GODEBUG in "go help environment"
Ian Lance Taylor [Mon, 22 Jul 2019 22:52:37 +0000 (15:52 -0700)]
cmd/go: mention GODEBUG in "go help environment"

Change-Id: Id2c07ccba7c514ec3a4bbd493edbc68ae5cd6250
Reviewed-on: https://go-review.googlesource.com/c/go/+/187157
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
4 years agodoc/go1.13: mention the effect of testing.Init on package initialization
Bryan C. Mills [Thu, 18 Jul 2019 21:41:45 +0000 (17:41 -0400)]
doc/go1.13: mention the effect of testing.Init on package initialization

Fixes #31859

Change-Id: I228ed93f9466d1a22f8796964f5d2f056ab9b62f
Reviewed-on: https://go-review.googlesource.com/c/go/+/186818
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Caleb Spare <cespare@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
4 years agoRevert "cmd/go: move automatic testing.Init call into generated test code"
Bryan C. Mills [Thu, 18 Jul 2019 21:34:59 +0000 (17:34 -0400)]
Revert "cmd/go: move automatic testing.Init call into generated test code"

This reverts CL 176098.

Reason for revert: added complexity, but did not completely fix the
underlying problem. A complete solution would not be worth the
complexity, and as a partial solution this is probably not worth the
complexity either.

Updates #31859

Change-Id: Ifd34c292fd1b811c60afe3c339e5edd3f37190c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/186817
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Caleb Spare <cespare@gmail.com>
4 years agocmd/go: document go get @upgrade behavior in release notes
Jay Conrod [Wed, 17 Jul 2019 22:55:18 +0000 (18:55 -0400)]
cmd/go: document go get @upgrade behavior in release notes

Fixes #33149

Change-Id: If9ff24fea6d087b4047a9f6e50f99f449f9b1c52
Reviewed-on: https://go-review.googlesource.com/c/go/+/186618
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agoruntime: align allocations harder in GODEBUG=sbrk=1 mode
Austin Clements [Thu, 18 Jul 2019 16:30:37 +0000 (12:30 -0400)]
runtime: align allocations harder in GODEBUG=sbrk=1 mode

Currently, GODEBUG=sbrk=1 mode aligns allocations by their type's
alignment. You would think this would be the right thing to do, but
because 64-bit fields are only 4-byte aligned right now (see #599),
this can cause a 64-bit field of an allocated object to be 4-byte
aligned, but not 8-byte aligned. If there is an atomic access to that
unaligned 64-bit field, it will crash.

This doesn't happen in normal allocation mode because the
size-segregated allocation and the current size classes will cause any
types larger than 8 bytes to be 8 byte aligned.

We fix this by making sbrk=1 mode use alignment based on the type's
size rather than its declared alignment. This matches how the tiny
allocator aligns allocations.

This was tested with

  GOARCH=386 GODEBUG=sbrk=1 go test sync/atomic

This crashes with an unaligned access before this change, and passes
with this change.

This should be reverted when/if we fix #599.

Fixes #33159.

Change-Id: Ifc52c72c6b99c5d370476685271baa43ad907565
Reviewed-on: https://go-review.googlesource.com/c/go/+/186919
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agotime: clarify when draining a Timer's channel is needed
Allen Li [Thu, 11 Jul 2019 00:57:57 +0000 (00:57 +0000)]
time: clarify when draining a Timer's channel is needed

Updates #27169

Change-Id: I22a6194c06529ba70b1ec648e3188c191224e321
GitHub-Last-Rev: 457b2a61a8ee4a745371c87756e5b6f38058af28
GitHub-Pull-Request: golang/go#32996
Reviewed-on: https://go-review.googlesource.com/c/go/+/185245
Reviewed-by: Rob Pike <r@golang.org>
4 years agocmd/go/internal/mvs: in Req, omit versions implied by older-than-selected versions...
Bryan C. Mills [Wed, 17 Jul 2019 18:31:48 +0000 (14:31 -0400)]
cmd/go/internal/mvs: in Req, omit versions implied by older-than-selected versions already in the graph

Fixes #31248

Change-Id: Ia54f2098c3b85549681198a487a31e8ce8fc59eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/186557
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agocmd/go/internal/mvs: retain modules required by older versions
Bryan C. Mills [Wed, 17 Jul 2019 16:53:47 +0000 (12:53 -0400)]
cmd/go/internal/mvs: retain modules required by older versions

Fixes #29773
Updates #31248

Change-Id: Ic1923119c8cf3a60c586df1b270c3af0c9095f29
Reviewed-on: https://go-review.googlesource.com/c/go/+/186537
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agocmd/go: in module mode, populate PackagePublic.Root with the module root
Bryan C. Mills [Tue, 11 Dec 2018 22:13:50 +0000 (17:13 -0500)]
cmd/go: in module mode, populate PackagePublic.Root with the module root

'go test' uses the Root field to determine the set of files that
invalidate test results, and there is no other sensible meaning of
“root” for code within a module.

Fixes #29111

Change-Id: Icf1be90a26d22665613e42cb968087b63c36e74c
Reviewed-on: https://go-review.googlesource.com/c/go/+/154100
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agocmd/go: suppress errors with '@upgrade' when the latest version is replaced
Bryan C. Mills [Wed, 17 Jul 2019 21:08:05 +0000 (17:08 -0400)]
cmd/go: suppress errors with '@upgrade' when the latest version is replaced

Fixes #33154

Change-Id: I5a249a77843a8bd438006af0fa1d8b4429ee25f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/186617
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agotest: new testcase for gccgo bug
Than McIntosh [Thu, 18 Jul 2019 12:18:58 +0000 (08:18 -0400)]
test: new testcase for gccgo bug

Updates #33158.

Change-Id: Id87eb00ddcb104ba8e7a0d2f6cf324a77a84f4a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/186717
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

4 years agotest: new testcase for gccgo bug
Than McIntosh [Thu, 18 Jul 2019 01:41:13 +0000 (21:41 -0400)]
test: new testcase for gccgo bug

Updates #33020

Change-Id: I82554ef20ea35e0087fd9ecd9548c2dfeacdc617
Reviewed-on: https://go-review.googlesource.com/c/go/+/186697
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agocmd/go: include GOEXPERIMENT flags in tool id for cache key
Jay Conrod [Mon, 15 Jul 2019 15:33:26 +0000 (11:33 -0400)]
cmd/go: include GOEXPERIMENT flags in tool id for cache key

The go command invokes each tool with -V=full to discover its version
to compute a tool id. For release versions (that don't include the
word "devel"), the go command only used the third word in
the output (e.g., "go1.13"), ignoring any toolchain experiments that
followed. With this change, the go command will use whole version line
in the tool id for release versions.

Also, when -V=full is set and there are non-default experiments,
experiments are no longer printed twice.

Fixes #33091

Change-Id: I19b96f939c7e2fbc5d8befe3659156ee4b58daef
Reviewed-on: https://go-review.googlesource.com/c/go/+/186200
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agonet/http/httputil: fix regression in ReverseProxy.ServeHTTP
Joe Tsai [Wed, 17 Jul 2019 00:40:20 +0000 (17:40 -0700)]
net/http/httputil: fix regression in ReverseProxy.ServeHTTP

In Go1.12 and below, the logic in ReverseProxy.ServeHTTP would always
allocate request.Header even if it were not present in the incoming request.
CL 174324 added http.Request.Clone and re-factors ReverseProxy.ServeHTTP
to use the new Clone method. However, the new Clone logic is not equivalent
to the former logic. We preserve former semantics by explicitly allocating
the Header map if nil.

Fixes #33142

Change-Id: I356f94a915dd9779584ce3fe31e56e5474b9ad37
Reviewed-on: https://go-review.googlesource.com/c/go/+/186437
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
4 years agodoc/go1.13: remove 1.12 reference from 1.13 release notes
Alberto Donizetti [Sun, 14 Jul 2019 17:08:57 +0000 (19:08 +0200)]
doc/go1.13: remove 1.12 reference from 1.13 release notes

While it's true that CL 168479 was also backported to 1.12, this is
irrelevant for the Go1.13 release notes.

Change-Id: I044be69f8f2bc005f58a0d63db05129add15f674
Reviewed-on: https://go-review.googlesource.com/c/go/+/186138
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agoCONTRIBUTORS: first round of updates for Go 1.13
Dmitri Shuralyov [Tue, 16 Jul 2019 20:29:49 +0000 (16:29 -0400)]
CONTRIBUTORS: first round of updates for Go 1.13

This update has been automatically generated using the updatecontrib
command:

cd gotip
go run golang.org/x/build/cmd/updatecontrib

With minor manual changes to canonicalize letter case for a few names.

Actions taken (relative to CONTRIBUTORS at origin/master):

Added Ahsun Ahmed <ahmed.ahsun@gmail.com>
Added Al Cutter <al@google.com>
Added Alex Tokarev <aleksator@gmail.com>
Added Alexander Lourier <aml@rulezz.ru>
Added Alexander Rakoczy <alex@golang.org>
Added Andrei Matei <andrei@cockroachlabs.com>
Added Andrei Vagin <avagin@google.com>
Added Andrew Z Allen <me@andrewzallen.com>
Added Aofei Sheng <aofei@aofeisheng.com>
Added Arash Bina <arash@arash.io>
Added Benjamin Peterson <benjamin@python.org>
Added Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Added Brandon Ryan <bjryan19@gmail.com>
Added Bryan Heden <b.heden@gmail.com>
Added Carlos Eduardo <me@carlosedp.com>
Added Carrie Bynon <cbynon@gmail.com>
Added Chris Marchesi <chrism@vancluevertech.com>
Added Colin Arnott <colin@urandom.co.uk>
Added Daniel Cormier <danielc@knowbe4.com>
Added Daniel Langner <s8572327@gmail.com>
Added Daniel Lublin <daniel@lublin.se>
Added Darren Grant <darren.e.grant@gmail.com>
Added Derek Phan <derekphan94@gmail.com>
Added Dmitri Goutnik <dgoutnik@gmail.com>
Added Dmitry Mottl <dmitry.mottl@gmail.com>
Added Eli Bendersky <eliben@google.com>
Added Evan Digby <evandigby@gmail.com>
Added Fedor Korotkiy <dartslon@gmail.com>
Added Felix Bünemann <Felix.Buenemann@gmail.com>
Added Francesco Renzi <rentziass@gmail.com>
Added Gabriel Guzman <gabe.guzman@gmail.com>
Added Gabriel Nelle <tehsphinx@web.de>
Added Gernot Vormayr <gvormayr@gmail.com>
Added GitHub User ZZMarquis (7624583) <zhonglingjian3821@163.com>
Added GitHub User alkesh26 (1019076) <alkesh26@gmail.com>
Added GitHub User bakape (7851952) <bakape@gmail.com>
Added GitHub User frennkie (6499251) <mail@rhab.de>
Added GitHub User hengwu0 (41297446) <41297446+hengwu0@users.noreply.github.com>
Added GitHub User kazyshr (30496953) <kazyshr0301@gmail.com>
Added GitHub User linguohua (3434367) <lghchinaidea@gmail.com>
Added GitHub User micnncim (21333876) <micnncim@gmail.com>
Added Gordon Tyler <gordon@doxxx.net>
Added Greg Thelen <gthelen@google.com>
Added Haosdent Huang <haosdent@gmail.com>
Added Hasan Ozgan <hasan@ozgan.net>
Added Henry Wong <liushuai.wang@elastic.co>
Added Horst Rutter <hhrutter@gmail.com>
Added Ivan Osadchiy <ivan.osadchii@gmail.com>
Added JT Olio <hello@jtolio.com>
Added Jacob Blain Christen <dweomer5@gmail.com>
Added Jacob Walker <jacobwalker0814@gmail.com>
Added James Nugent <james@jen20.com>
Added Jannis Andrija Schnitzer <jannis@schnitzer.im>
Added Jean-François Bustarret <jf@bustarret.com>
Added Jeremy Jay <jeremy@pbnjay.com>
Added Jeroen Simonetti <jeroen@simonetti.nl>
Added Jingnan Si <jingnan.si@gmail.com>
Added Jinkun Zhang <franksnolf@gmail.com>
Added John Moore <johnkenneth.moore@gmail.com>
Added John Weldon <johnweldon4@gmail.com>
Added Jonathon Lacher <jonathon.lacher@gmail.com>
Added Jordan Liggitt <liggitt@google.com>
Added Joshua M. Clulow <josh.clulow@joyent.com>
Added Juraj Sukop <sukop@users.noreply.github.com>
Added Justin Li <git@justinli.net>
Added Kai Dong <dokia2357@gmail.com>
Added Kenichi Tsunokawa <kenichi.tsunokawa@gmail.com>
Added Kenta Mori <zoncoen@gmail.com>
Added Ketan Parmar <ketanbparmar@gmail.com>
Added Kirill Motkov <Motkov.Kirill@gmail.com>
Added Kshitij Saraogi <kshitijsaraogi@gmail.com>
Added Leonardo Comelli <leonardo.comelli@gmail.com>
Added Lorenz Nickel <mail@lorenznickel.de>
Added Luka Zitnik <luka.zitnik@gmail.com>
Added Luke Champine <luke.champine@gmail.com>
Added Madhu Rajanna <madhupr007@gmail.com>
Added Marat Khabibullin <marat.khabibullin@jetbrains.com>
Added Mark Villacampa <m@markvillacampa.com>
Added Max Semenik <maxsem.wiki@gmail.com>
Added Maxim Eryomenko <moeryomenko@gmail.com>
Added Michael Cook <code@mdcook.net>
Added Michael Vogt <mvo@ubuntu.com>
Added Mickael KERJEAN <mickael.kerjean@gmail.com>
Added Mickey Reiss <mickeyreiss@gmail.com>
Added Mihai Moldovan <ionic@ionic.de>
Added Mirko Hansen <baaazen@gmail.com>
Added Muir Manders <muir@mnd.rs>
Added Mykhailo Lesyk <mikhail@lesyk.org>
Added Nick Anthony <Liberatys@outlook.com>
Added Nikita Kryuchkov <nkryuchkov10@gmail.com>
Added Nir Soffer <nirsof@gmail.com>
Added Norman B. Lancaster <qbradq@gmail.com>
Added Patrick Barker <barkerp@vmware.com>
Added Patrik Lundin <patrik@sigterm.se>
Added Petr Jediný <petr.jediny@gmail.com>
Added Robert Ayrapetyan <robert.ayrapetyan@gmail.com>
Added Robert van Gent <rvangent@google.com>
Added Rohan Verma <rohanverma2004@gmail.com>
Added Romain Baugue <romain.baugue@elwinar.com>
Added Sad Pencil <qh06@qq.com>
Added Segev Finer <segev208@gmail.com>
Added Sergey Dobrodey <sergey.dobrodey@synesis.ru>
Added Sergey Yanykin <syanykin@ozon.ru>
Added Shawn Elliott <selliott@microsoft.com>
Added Shengjing Zhu <zsj950618@gmail.com>
Added Shubham Sharma <shubham.sha12@gmail.com>
Added Stephan Zuercher <zuercher@gmail.com>
Added Steve Mynott <steve.mynott@gmail.com>
Added Tai Le <letientai299@gmail.com>
Added Todd Kulesza <tkulesza@google.com>
Added Tom Anthony <git@tomanthony.co.uk>
Added Tooru Takahashi <tooru.takahashi134@gmail.com>
Added Udalov Max <re.udalov@gmail.com>
Added Valentin Vidic <vvidic@valentin-vidic.from.hr>
Added Vivek Sekhar <vsekhar@google.com>
Added WEI Xikai <xykwei@gmail.com>
Added Wenlei (Frank) He <wlhe@google.com>
Added Wenzel Lowe <lowewenzel@gmail.com>
Added Yang Tian <linuxty@gmail.com>
Added Yasser Abdolmaleki <yasser@yasser.ca>
Added Zach Jones <zachj1@gmail.com>
Added adarsh ravichandran <adarshravichandran91@gmail.com>
Added berkant ipek <41230766+0xbkt@users.noreply.github.com>
Added karthik nayak <karthik.188@gmail.com>
Added marius a. eriksen <marius@grailbio.com>
Added Максадбек Ахмедов <a.maksadbek@gmail.com>
Used GitHub User ZZMarquis (7624583) form for ZZMarquis <zhonglingjian3821@163.com> https://github.com/golang/go/commit/b00ef3b865 [go]
Used GitHub User alkesh26 (1019076) form for alkesh26 <alkesh26@gmail.com> https://github.com/golang/go/commit/c7f69a2897 [go]
Used GitHub User bakape (7851952) form for bakape <bakape@gmail.com> https://github.com/golang/go/commit/27e444d5e6 [go]
Used GitHub User frennkie (6499251) form for frennkie <mail@rhab.de> https://github.com/golang/go/commit/ee46250e06 [go]
Used GitHub User hengwu0 (41297446) form for hengwu0 <41297446+hengwu0@users.noreply.github.com> https://github.com/golang/go/commit/95d4e6158b [go]
Used GitHub User kazyshr (30496953) form for kazyshr <kazyshr0301@gmail.com> https://github.com/golang/tools/commit/0fdf0c73 [tools]
Used GitHub User linguohua (3434367) form for linguohua <lghchinaidea@gmail.com> https://github.com/golang/tools/commit/97de5656 [tools]
Used GitHub User micnncim (21333876) form for micnncim <micnncim@gmail.com> https://github.com/golang/tools/commit/15d5d381 [tools]
Used GitHub name "Akhil Indurti" for smasher164 <aindurti@gmail.com> https://github.com/golang/go/commit/5ca44dc403 [build go]
Used GitHub name "Carlos Eduardo" for CarlosEDP <me@carlosedp.com> https://github.com/golang/net/commit/018c4d4 [net]
Used GitHub name "Ivan Markin" for nogoegst <nogoegst@users.noreply.github.com> https://github.com/golang/go/commit/a1addf15df [go]
Used GitHub name "Jean-François Bustarret" for jfbus <jf@bustarret.com> https://github.com/golang/go/commit/825ff1e317 [go]
Used GitHub name "Jinkun Zhang" for smileeye <franksnolf@gmail.com> https://github.com/golang/go/commit/607493bed6 [go]
Used GitHub name "John Moore" for guitarbum722 <johnkenneth.moore@gmail.com> https://github.com/golang/go/commit/44c9354c5a [go]
Used GitHub name "Keiji Yoshida" for yosssi <yoshida.keiji.84@gmail.com> https://github.com/golang/lint/commit/ac6833c [lint]
Used GitHub name "Kenta Mori" for zoncoen <zoncoen@gmail.com> https://github.com/golang/net/commit/fe579d4 [net]
Used GitHub name "Kirill Motkov" for Motkov.Kirill <Motkov.Kirill@gmail.com> https://github.com/golang/go/commit/0ff0df8be3 [go]
Used GitHub name "Luke Champine" for lukechampine <luke.champine@gmail.com> https://github.com/golang/go/commit/9d40fadb1c [crypto go]
Used GitHub name "Michalis Kargakis" for kargakis <mkargaki@redhat.com> https://github.com/golang/go/commit/e243d242d7 [go]
Used GitHub name "Nick Anthony" for Liberatys <Liberatys@outlook.com> https://github.com/golang/go/commit/62ddf7d0c5 [go]
Used GitHub name "Robert Ayrapetyan" for rayrapetyan <robert.ayrapetyan@gmail.com> https://github.com/golang/sys/commit/bf70e46 [sys]
Used GitHub name "Robin Eklind" for mewmew <rnd0x00@gmail.com> https://github.com/golang/go/commit/b8620afb8d [blog go proposal.git]
Used GitHub name "Sergey Dobrodey" for sergeydobrodey <sergey.dobrodey@synesis.ru> https://github.com/golang/net/commit/e869164 [net]
Used GitHub name "Tai Le" for Tai <letientai299@gmail.com> https://github.com/golang/build/commit/1b388d2 [build tools]
Used GitHub name "WEI Xikai" for ShiKaiWi <xykwei@gmail.com> https://github.com/golang/go/commit/518ee55d78 [go]
Used GitHub name "Yang Tian" for taoyuanyuan <linuxty@gmail.com> https://github.com/golang/go/commit/5eeb372418 [go]
Used GitHub name "Zach Jones" for zdjones <zachj1@gmail.com> https://github.com/golang/go/commit/c178389604 [go]

Updates #12042

Change-Id: Ic220d997a0dc3bf4109ab964cbb6a25ea5c0c9da
Reviewed-on: https://go-review.googlesource.com/c/go/+/186397
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agocmd/go: tweak wording of module path mismatch error message
Jay Conrod [Tue, 16 Jul 2019 16:51:34 +0000 (12:51 -0400)]
cmd/go: tweak wording of module path mismatch error message

Changes "was loaded as" to "was required as". This is slightly more
precise, since it hints at a requirement edge in the module version
graph.

Updates #28489

Change-Id: I636268c33f1ea9858c214fe275f271538186ed6d
Reviewed-on: https://go-review.googlesource.com/c/go/+/186377
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agoruntime: add a test for getg with thread switch
Cherry Zhang [Tue, 16 Jul 2019 15:33:10 +0000 (11:33 -0400)]
runtime: add a test for getg with thread switch

With gccgo, if we generate getg inlined, the backend may cache
the address of the TLS variable, which will become invalid after
a thread switch.

Currently there is no known bug for this. But if we didn't
implement this carefully, we may get subtle bugs. This CL adds a
test that will fail loudly if this is wrong. (See also
https://go.googlesource.com/gofrontend/+/refs/heads/master/libgo/runtime/proc.c#333
and an incorrect attempt CL 185337.)

Note: at least on Linux/AMD64, even with an incorrect
implementation, this only fails if the test is compiled with
-fPIC, which is not the default setting for gccgo test suite. So
some manual work is needed. Maybe we could extend the test suite
to run the runtime test with more settings (e.g. PIC and static).

Change-Id: I459a3b4c31f09b9785c0eca19b7756f80e8ef54c
Reviewed-on: https://go-review.googlesource.com/c/go/+/186357
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 years agocmd/go: tighten the check for pseudo-version base tags
Bryan C. Mills [Tue, 2 Jul 2019 21:03:27 +0000 (17:03 -0400)]
cmd/go: tighten the check for pseudo-version base tags

Do not allow a pseudo-version derived from a canonical tag to refer to
the same revision as the tag itself. It's unnecessary (because
canonical tags already have a total ordering) and confusing (the
pseudo-version appears to come after the tag, but actually refers to
the exact same revision).

Updates #32879
Updates #27173

Change-Id: I02befedbe89c8819bdd93e470783ce63fc813193
Reviewed-on: https://go-review.googlesource.com/c/go/+/184720
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agocmd/go: clarify error text for module path mismatch
Jay Conrod [Fri, 12 Jul 2019 21:31:59 +0000 (17:31 -0400)]
cmd/go: clarify error text for module path mismatch

This error occurs when a module is loaded with one name (for example,
github.com/golang/lint) but declares a different path in its go.mod
(golang.org/x/lint). The current text "unexpected module path" is
confusing. It doesn't explain why the path was unexpected, and it's
not clear what was expected.

With this change, the error text includes the module and version
containing the go.mod file with the error, the declared module path,
and the loaded module path. The paths are vertically aligned so
differences are visually obvious. As with other module version errors,
the shortest chain of requirements is printed.

This change supercedes CL 158477.

Fixes #28489

Change-Id: Ieb07d00bcae182376d7be6aad111c84fbf784354
Reviewed-on: https://go-review.googlesource.com/c/go/+/185985
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agocrypto/tls: deprecate SSLv3 support
Filippo Valsorda [Thu, 27 Jun 2019 23:00:08 +0000 (19:00 -0400)]
crypto/tls: deprecate SSLv3 support

Updates #32716

Change-Id: Ia0c03918e8f2da4d9824c49c6d4cfca1b0787b0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/184102
Reviewed-by: Andrew Bonventre <andybons@golang.org>
4 years agocmd/link: put shlib ".type" functions in internal ABI
Ian Lance Taylor [Sat, 13 Jul 2019 19:20:43 +0000 (12:20 -0700)]
cmd/link: put shlib ".type" functions in internal ABI

These functions are compiler generated, and as such are only available
in the internal ABI. Doing this avoids generating an alias symbol.
Doing that avoids confusion between unmangled and mangled type symbols.

Fixes #30768

Change-Id: I197a5ba6403aac11989ffa951dbe35bd0506de91
Reviewed-on: https://go-review.googlesource.com/c/go/+/186077
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
4 years agocmd/go/internal/modfetch: always check for a go.mod file when fetching from version...
Bryan C. Mills [Mon, 15 Jul 2019 18:06:58 +0000 (14:06 -0400)]
cmd/go/internal/modfetch: always check for a go.mod file when fetching from version control

If the module path declared in the go.mod file does not match the path
we are trying to resolve, a build using that module is doomed to fail.
Since we know that the module path does not match in the underlying
repo, we also know that the requested module does not exist at the
requested version.

Therefore, we should reject that version in Stat with a “not exist”
error — sooner rather than later — so that modload.Query will continue
to check other candidate paths (for example, with a major-version
suffix added or removed).

Fixes #33099

Change-Id: I43c980f78ed75fa6ace90f237cc3aad46c22d83a
Reviewed-on: https://go-review.googlesource.com/c/go/+/186237
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agocrypto/tls: remove TestVerifyHostnameResumed
Filippo Valsorda [Mon, 15 Jul 2019 20:45:17 +0000 (16:45 -0400)]
crypto/tls: remove TestVerifyHostnameResumed

Session resumption is not a reliable TLS behavior: the server can decide
to reject a session ticket for a number of reasons, or no reason at all.
This makes this non-hermetic test extremely brittle.

It's currently broken on the builders for both TLS 1.2 and TLS 1.3, and
I could reproduce the issue for TLS 1.3 only. As I was debugging it, it
started passing entirely on my machine.

In practice, it doesn't get us any coverage as resumption is already
tested with the recorded exchange tests, and TestVerifyHostname still
provides a smoke test checking that we can in fact talk TLS.

Fixes #32978

Change-Id: I63505e22ff7704f25ad700d46e4ff14850ba5d3c
Reviewed-on: https://go-review.googlesource.com/c/go/+/186239
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
4 years agocmd/go: check for source files in relative paths before attempting to determine the...
Bryan C. Mills [Tue, 9 Jul 2019 21:41:37 +0000 (17:41 -0400)]
cmd/go: check for source files in relative paths before attempting to determine the package path

This is a more minimial fix for the immediate symptom of 32917 and
30590, but does not improve 'list -e' behavior or error
messages resulting from other package loading issues.

Fixes #32917
Fixes #30590

Change-Id: I6088d14d864410159ebf228d9392d186322fd2a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/185417
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agocmd/go: add go command known variables to test cache hash
LE Manh Cuong [Tue, 28 May 2019 16:07:56 +0000 (23:07 +0700)]
cmd/go: add go command known variables to test cache hash

The go test result must not be cached when each of known variables to go
command change.

To do this, add all known variables to test metadata.

Fixes #32285

Change-Id: I90be6a72f46c42d965aec4fed534c0623244cd3d
Reviewed-on: https://go-review.googlesource.com/c/go/+/179040
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
4 years agodoc/go1.13: fix misspelling of "interpreted"
Alberto Donizetti [Sun, 14 Jul 2019 16:48:20 +0000 (18:48 +0200)]
doc/go1.13: fix misspelling of "interpreted"

Change-Id: I465f10533cc76d8160e56bc49eabaf8127ac4e61
Reviewed-on: https://go-review.googlesource.com/c/go/+/186137
Reviewed-by: Andrew Bonventre <andybons@golang.org>