]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
5 years ago[release-branch.go1.12] go1.12rc1 go1.12rc1
Andrew Bonventre [Mon, 11 Feb 2019 20:02:50 +0000 (15:02 -0500)]
[release-branch.go1.12] go1.12rc1

Change-Id: Iac838b852061a8469e4e201670a589fa2bed9f04
Reviewed-on: https://go-review.googlesource.com/c/161900
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/go/internal/modcmd: use replaced paths to break cycles in 'go mod tidy'
Bryan C. Mills [Mon, 11 Feb 2019 17:56:09 +0000 (12:56 -0500)]
cmd/go/internal/modcmd: use replaced paths to break cycles in 'go mod tidy'

Fixes #30166

Change-Id: I4704b57ed48197f512cd1b818e1f7d2fffc0d9ce
Reviewed-on: https://go-review.googlesource.com/c/161898
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agodoc: remove last pieces of advice to set GOROOT
Daniel Martí [Fri, 8 Feb 2019 11:22:48 +0000 (11:22 +0000)]
doc: remove last pieces of advice to set GOROOT

install.html still insisted that GOROOT must be set if a binary install
of Go is set up in a custom directory. However, since 1.10, this has
been unnecessary as the GOROOT will be found based on the location of
the 'go' binary being run.

Likewise, install-source.html includes an 'export GOROOT' line in a
section that only talks about explicitly setting GOARCH and GOOS, which
is optional. We don't want to have users think it is recommended to set
GOROOT here either, so remove the unnecessary line.

Change-Id: I7dfef09f9a1d003e0253b793d63ea40d5cf1837f
Reviewed-on: https://go-review.googlesource.com/c/161758
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agosync/atomic: add 32-bit MIPS to the 64-bit alignment requirement
Ian Lance Taylor [Fri, 8 Feb 2019 00:55:17 +0000 (16:55 -0800)]
sync/atomic: add 32-bit MIPS to the 64-bit alignment requirement

runtime/internal/atomic/atomic_mipsx.go enforces 64-bit alignment.

Change-Id: Ifdc36e1c0322827711425054d10f1c52425a13fa
Reviewed-on: https://go-review.googlesource.com/c/161697
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agodoc: fix typos
alkesh26 [Sat, 9 Feb 2019 17:33:42 +0000 (17:33 +0000)]
doc: fix typos

Change-Id: I46046cddceff2d44a7b2517db1ebf7acdf5f2b90
GitHub-Last-Rev: 7fb9f26476d2764f07d068ce612bf79b1e7f44b4
GitHub-Pull-Request: golang/go#30144
Reviewed-on: https://go-review.googlesource.com/c/161718
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodatabase/sql: document Stmt lifetime
Justin Li [Wed, 23 Jan 2019 15:15:06 +0000 (15:15 +0000)]
database/sql: document Stmt lifetime

When prepared on a DB, prepared statement code in database/sql handles everything to keep the prepared statement alive as it moves across the connection pool. Understanding this is an important part of using this API correctly, but it was only documented indirectly via `(*Tx) Prepare*`.

Change-Id: Ic8757e0150d59e675d9f0252f6c15aef2cc2e831
GitHub-Last-Rev: 55dba87458542cb631baac80aeea0c3607d8f421
GitHub-Pull-Request: golang/go#29890
Reviewed-on: https://go-review.googlesource.com/c/159077
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
5 years agocrypto/tls: disable RSA-PSS in TLS 1.2
Filippo Valsorda [Tue, 5 Feb 2019 20:27:56 +0000 (15:27 -0500)]
crypto/tls: disable RSA-PSS in TLS 1.2

Most of the issues that led to the decision on #30055 were related to
incompatibility with or faulty support for RSA-PSS (#29831, #29779,
v1.5 signatures). RSA-PSS is required by TLS 1.3, but is also available
to be negotiated in TLS 1.2.

Altering TLS 1.2 behavior based on GODEBUG=tls13=1 feels surprising, so
just disable RSA-PSS entirely in TLS 1.2 until TLS 1.3 is on by default,
so breakage happens all at once.

Updates #30055

Change-Id: Iee90454a20ded8895e5302e8bcbcd32e4e3031c2
Reviewed-on: https://go-review.googlesource.com/c/160998
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
5 years agocrypto/tls: make TLS 1.3 opt-in
Filippo Valsorda [Tue, 5 Feb 2019 20:29:02 +0000 (15:29 -0500)]
crypto/tls: make TLS 1.3 opt-in

Updates #30055

Change-Id: If68615c8e9daa4226125dcc6a6866f29f3cfeef1
Reviewed-on: https://go-review.googlesource.com/c/160997
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocrypto/x509: consider parents by Subject if AKID has no match
Filippo Valsorda [Mon, 4 Feb 2019 23:08:43 +0000 (18:08 -0500)]
crypto/x509: consider parents by Subject if AKID has no match

If a certificate somehow has an AKID, it should still chain successfully
to a parent without a SKID, even if the latter is invalid according to
RFC 5280, because only the Subject is authoritative.

This reverts to the behavior before #29233 was fixed in 770130659. Roots
with the right subject will still be shadowed by roots with the right
SKID and the wrong subject, but that's been the case for a long time, and
is left for a more complete fix in Go 1.13.

Updates #30079

Change-Id: If8ab0179aca86cb74caa926d1ef93fb5e416b4bb
Reviewed-on: https://go-review.googlesource.com/c/161097
Reviewed-by: Adam Langley <agl@golang.org>
5 years agotest/chan: fix broken link to Squinting at Power Series
Yasser Abdolmaleki [Wed, 6 Feb 2019 06:14:44 +0000 (22:14 -0800)]
test/chan: fix broken link to Squinting at Power Series

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

5 years agocrypto/x509: improve CertificateRequest docs
Filippo Valsorda [Tue, 5 Feb 2019 21:08:35 +0000 (16:08 -0500)]
crypto/x509: improve CertificateRequest docs

Change-Id: If3bab2dd5278ebc621235164e9d6ff710ba326ee
Reviewed-on: https://go-review.googlesource.com/c/160898
Reviewed-by: Adam Langley <agl@golang.org>
5 years agodoc: fix a typo
alkesh26 [Tue, 5 Feb 2019 10:05:10 +0000 (10:05 +0000)]
doc: fix a typo

Change-Id: Ia830f59d6f6ca1bc506ec298ccfc154d9f94f01d
GitHub-Last-Rev: 3ab18d4fd1a8d4295713cbb7ff74f30b3838b6d3
GitHub-Pull-Request: golang/go#30067
Reviewed-on: https://go-review.googlesource.com/c/160829
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc: go1.12: document FreeBSD 12.0 requires COMPAT_FREEBSD11
Yuval Pavel Zholkover [Fri, 1 Feb 2019 15:58:01 +0000 (17:58 +0200)]
doc: go1.12: document FreeBSD 12.0 requires COMPAT_FREEBSD11

Fixes #22447
Fixes #22448

Change-Id: Ia24f42c31e014c79040ff927f1247dfb2318de4f
Reviewed-on: https://go-review.googlesource.com/c/160778
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
5 years agocmd/go: clarify @none effect on dependants modules
Alberto Donizetti [Mon, 4 Feb 2019 19:07:46 +0000 (20:07 +0100)]
cmd/go: clarify @none effect on dependants modules

Expand modules documentation to clarify why @none is useful. The
wording is the one suggested by rsc on the issue.

Fixes #26684

Change-Id: I76dc4ff87e50f1dd8536fd9ac1fd938adb29bee3
Reviewed-on: https://go-review.googlesource.com/c/161037
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocrypto/aes: replace broken extenal link to FIPS 197
spring1843 [Sun, 3 Feb 2019 05:09:55 +0000 (21:09 -0800)]
crypto/aes: replace broken extenal link to FIPS 197

Change-Id: Ib0a0d04aaaaa3c213fdb8646bd9b7dfdadae40d4
Reviewed-on: https://go-review.googlesource.com/c/160831
Reviewed-by: Filippo Valsorda <filippo@golang.org>
5 years agocmd/cgo: don't copy a simple variable x in &x[0]
Ian Lance Taylor [Sun, 3 Feb 2019 00:03:28 +0000 (16:03 -0800)]
cmd/cgo: don't copy a simple variable x in &x[0]

Fixes #30065

Change-Id: I3d0fb03bab397548653d5f3b386cfe2980ac1030
Reviewed-on: https://go-review.googlesource.com/c/160830
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: fix crash when memmove argument is not the right type
Keith Randall [Fri, 1 Feb 2019 23:27:53 +0000 (15:27 -0800)]
cmd/compile: fix crash when memmove argument is not the right type

Make sure the argument to memmove is of pointer type before we try to
get the element type.

This has been noticed for code that uses unsafe+linkname so it can
call runtime.memmove. Probably not the best thing to allow, but the
code is out there and we'd rather not break it unnecessarily.

Fixes #30061

Change-Id: I334a8453f2e293959fd742044c43fbe93f0b3d31
Reviewed-on: https://go-review.googlesource.com/c/160826
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agoreflect: eliminate write barrier for copying result in callReflect
Cherry Zhang [Fri, 1 Feb 2019 01:29:21 +0000 (20:29 -0500)]
reflect: eliminate write barrier for copying result in callReflect

We are copying the results to uninitialized stack space. Write
barrier is not needed.

Fixes #30041.

Change-Id: Ia91d74dbafd96dc2bd92de0cb479808991dda03e
Reviewed-on: https://go-review.googlesource.com/c/160737
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agodoc: go1.12: update notes on go directive
Ian Lance Taylor [Fri, 1 Feb 2019 14:22:00 +0000 (06:22 -0800)]
doc: go1.12: update notes on go directive

Fixes #30043

Change-Id: I4ecfff7d8a9432240c1927f7484786fe1182b773
Reviewed-on: https://go-review.googlesource.com/c/160797
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/cgo: ignore unrecognized GCC warning group pragmas
Yuval Pavel Zholkover [Fri, 1 Feb 2019 11:51:31 +0000 (13:51 +0200)]
cmd/cgo: ignore unrecognized GCC warning group pragmas

CL 159859 causes build failure with old clang versions (3.4.1) on FreeBSD 10.3/10.4.

Update #29962
Update #27619

Change-Id: I78264ac5d8d17eeae89a982e89aac988eb22b286
Reviewed-on: https://go-review.googlesource.com/c/160777
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agoruntime: add credit system for scavenging
Michael Anthony Knyszek [Tue, 29 Jan 2019 19:58:29 +0000 (19:58 +0000)]
runtime: add credit system for scavenging

When scavenging small amounts it's possible we over-scavenge by a
significant margin since we choose to scavenge the largest spans first.
This over-scavenging is never accounted for.

With this change, we add a scavenge credit pool, similar to the reclaim
credit pool. Any time scavenging triggered by RSS growth starts up, it
checks if it can cash in some credit first. If after using all the
credit it still needs to scavenge, then any extra it does it adds back
into the credit pool.

This change mitigates the performance impact of golang.org/cl/159500 on
the Garbage benchmark. On Go1 it suggests some improvements, but most of
that is within the realm of noise (Revcomp seems very sensitive to
GC-related changes, both postively and negatively).

Garbage: https://perf.golang.org/search?q=upload:20190131.5
Go1:     https://perf.golang.org/search?q=upload:20190131.4

Performance change with both changes:

Garbage: https://perf.golang.org/search?q=upload:20190131.7
Go1:     https://perf.golang.org/search?q=upload:20190131.6

Change-Id: I87bd3c183e71656fdafef94714194b9fdbb77aa2
Reviewed-on: https://go-review.googlesource.com/c/160297
Reviewed-by: Austin Clements <austin@google.com>
5 years agoruntime: scavenge memory upon allocating from scavenged memory
Michael Anthony Knyszek [Fri, 25 Jan 2019 17:40:40 +0000 (17:40 +0000)]
runtime: scavenge memory upon allocating from scavenged memory

Because scavenged and unscavenged spans no longer coalesce, memory that
is freed no longer has a high likelihood of being re-scavenged. As a
result, if an application is allocating at a fast rate, it may work fast
enough to undo all the scavenging work performed by the runtime's
current scavenging mechanisms. This behavior is exacerbated by the
global best-fit allocation policy the runtime uses, since scavenged
spans are just as likely to be chosen as unscavenged spans on average.

To remedy that, we treat each allocation of scavenged space as a heap
growth, and scavenge other memory to make up for the allocation.

This change makes performance of the runtime slightly worse, as now
we're scavenging more often during allocation. The regression is
particularly obvious with the garbage benchmark (3%) but most of the Go1
benchmarks are within the margin of noise. A follow-up change should
help.

Garbage: https://perf.golang.org/search?q=upload:20190131.3
Go1:     https://perf.golang.org/search?q=upload:20190131.2

Updates #14045.

Change-Id: I44a7e6586eca33b5f97b6d40418db53a8a7ae715
Reviewed-on: https://go-review.googlesource.com/c/159500
Reviewed-by: Austin Clements <austin@google.com>
5 years agocmd/cgo: disable GCC 9 warnings triggered by cgo code
Ian Lance Taylor [Mon, 28 Jan 2019 20:31:55 +0000 (12:31 -0800)]
cmd/cgo: disable GCC 9 warnings triggered by cgo code

GCC 9 has started emitting warnings when taking the address of a field
in a packed struct may cause a misaligned pointer. We use packed
structs in cgo to ensure that our field layout matches the C
compiler's layout. Our pointers are always aligned, so disable the warning

Fixes #29962

Change-Id: I7e290a7cf694a2c2958529e340ebed9fcd62089c
Reviewed-on: https://go-review.googlesource.com/c/159859
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agoCONTRIBUTORS: second round of updates for Go 1.12
Dmitri Shuralyov [Tue, 29 Jan 2019 18:58:21 +0000 (13:58 -0500)]
CONTRIBUTORS: second round of updates for Go 1.12

This update has been automatically generated using the updatecontrib
command at CL 160277:

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

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

Added Aaron Cannon <cannona@fireantproductions.com>
Added Andzej Maciusovic <andzej.maciusovic@gmail.com>
Added Douglas Danger Manley <doug.manley@gmail.com>
Added Federico Bond <federicobond@gmail.com>
Added Frew Schmidt <github@frew.co>
Added GitHub User @saitarunreddy (21041941) <saitarunreddypalla@gmail.com>
Added GitHub User @tell-k (26263) <ffk2005@gmail.com>
Added Guilherme Caruso <gui.martinscaruso@gmail.com>
Added Jay Taylor <outtatime@gmail.com>
Added Juan Pablo Civile <elementohb@gmail.com>
Added Julien Kauffmann <julien.kauffmann@freelan.org>
Added Maya Rashish <maya@NetBSD.org>
Added Parminder Singh <parmsingh101@gmail.com>
Added Peter Dotchev <dotchev@gmail.com>
Added Quinten Yearsley <qyearsley@chromium.org>
Added Ross Smith II <ross@smithii.com>
Added Sean Chen <oohcode@gmail.com>
Added Sebastiaan van Stijn <github@gone.nl>
Added Sebastian Schmidt <yath@google.com>
Added Sebastien Williams-Wynn <sebastien@cytora.com>
Added Viacheslav Poturaev <vearutop@gmail.com>
Added Yohei Takeda <yo.tak0812@gmail.com>
Used GitHub User @saitarunreddy (21041941) form for saitarunreddy <saitarunreddypalla@gmail.com> https://github.com/golang/build/commit/269e03a [build]
Used GitHub User @tell-k (26263) form for tell-k <ffk2005@gmail.com> https://github.com/golang/tools/commit/85a87a81 [tools]
Used GitHub name "Akhil Indurti" for smasher164 <aindurti@gmail.com> https://github.com/golang/go/commit/a7af474359 [build go]
Used GitHub name "Guilherme Caruso" for GuilhermeCaruso <gui.martinscaruso@gmail.com> https://github.com/golang/go/commit/5fae09b738 [go]
Used GitHub name "Ivan Markin" for nogoegst <nogoegst@users.noreply.github.com> https://github.com/golang/go/commit/a1addf15df [go]
Used GitHub name "Keiji Yoshida" for yosssi <yoshida.keiji.84@gmail.com> https://github.com/golang/lint/commit/ac6833c [lint]
Used GitHub name "Marwan Sulaiman" for marwan-at-work <marwan.sameer@gmail.com> https://github.com/golang/go/commit/92caeef892 [go]
Used GitHub name "Michalis Kargakis" for kargakis <mkargaki@redhat.com> https://github.com/golang/go/commit/e243d242d7 [go]
Used GitHub name "Robin Eklind" for mewmew <rnd0x00@gmail.com> https://github.com/golang/go/commit/b8620afb8d [go proposal.git]
Used GitHub name "Sean Chen" for two <oohcode@gmail.com> https://github.com/golang/sys/commit/302c3dd [sys]
Used GitHub name "Sebastien Williams-Wynn" for GiantsLoveDeathMetal <sebastien@cytora.com> https://github.com/golang/go/commit/4e056ade24 [go]
Used GitHub name "Yohei Takeda" for yo-tak <yo.tak0812@gmail.com> https://github.com/golang/go/commit/8b7cf898af [go]

Given that the scope of updatecontrib is only to add contributors to
CONTRIBUTORS file, without having to check CLAs or deal with legal
matters, we can relax the requirement of having a space in the name
before it gets added to the CONTRIBUTORS file. That will be done
in a later change.

Updates #12042

Change-Id: I70248f3c82a836ee829256898e931e638ee45eb4
Reviewed-on: https://go-review.googlesource.com/c/160261
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodoc: note go tool tour removal in 1.12 release notes
Alberto Donizetti [Sat, 19 Jan 2019 17:24:32 +0000 (18:24 +0100)]
doc: note go tool tour removal in 1.12 release notes

Note the removal of the go tool tour command in the Go 1.12 release
notes.

Updates #24819

Change-Id: I258ab9401ea2cc06a83328c67299376fcf23c980
Reviewed-on: https://go-review.googlesource.com/c/158618
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
5 years agoos: treat EACCES as a permission error in RemoveAll
Ian Lance Taylor [Tue, 29 Jan 2019 23:57:41 +0000 (15:57 -0800)]
os: treat EACCES as a permission error in RemoveAll

Fixes #29983

Change-Id: I24077bde991e621c23d00973b2a77bb3a18e4ae7
Reviewed-on: https://go-review.googlesource.com/c/160180
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agoos: restore RemoveAll docs by making a single copy
Ian Lance Taylor [Wed, 30 Jan 2019 00:36:25 +0000 (16:36 -0800)]
os: restore RemoveAll docs by making a single copy

Updates #29983

Change-Id: Ifdf8aa9c92e053374e301a4268d85e277c15f0b5
Reviewed-on: https://go-review.googlesource.com/c/160182
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodoc: remove meaningless word from Go 1.12 release notes
Ian Lance Taylor [Tue, 29 Jan 2019 21:23:07 +0000 (13:23 -0800)]
doc: remove meaningless word from Go 1.12 release notes

Change-Id: I744940e2bbde19ccec53af6c5469d46ba9161f01
Reviewed-on: https://go-review.googlesource.com/c/160179
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
5 years agoos: make openFdAt act like openFileNolog
Ian Lance Taylor [Wed, 30 Jan 2019 00:34:27 +0000 (16:34 -0800)]
os: make openFdAt act like openFileNolog

- add EINTR loop on Darwin
- return PathError on error
- call newFile rather than NewFile

This tries to minimize the possibility of any future changes.
It would be nice to put openFdAt in the same file as openFileNolog,
but build tags forbid.

Updates #29983

Change-Id: I866002416d6473fbfd80ff6ef09b2bc4607f2934
Reviewed-on: https://go-review.googlesource.com/c/160181
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
5 years agonet/url, net/http: relax CTL-in-URL validation to only ASCII CTLs
Brad Fitzpatrick [Tue, 29 Jan 2019 17:22:36 +0000 (17:22 +0000)]
net/url, net/http: relax CTL-in-URL validation to only ASCII CTLs

CL 159157 was doing UTF-8 decoding of URLs. URLs aren't really UTF-8,
even if sometimes they are in some contexts.

Instead, only reject ASCII CTLs.

Updates #27302
Updates #22907

Change-Id: Ibd64efa5d3a93263d175aadf1c9f87deb4670c62
Reviewed-on: https://go-review.googlesource.com/c/160178
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc/go1.12: add notes about 'go doc -src'
kim yongbin [Thu, 27 Dec 2018 02:33:15 +0000 (11:33 +0900)]
doc/go1.12: add notes about 'go doc -src'

Change-Id: Iaf67fcbb145277327e24150b29ff38f6c65f6a03
Reviewed-on: https://go-review.googlesource.com/c/155781
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc: go1.12: mention change in text/template user function panic
Ian Lance Taylor [Tue, 29 Jan 2019 02:42:37 +0000 (18:42 -0800)]
doc: go1.12: mention change in text/template user function panic

Updates #28242

Change-Id: Ib717b64f1f368cc889895a2437ff2943ed4eab0d
Reviewed-on: https://go-review.googlesource.com/c/159998
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
5 years agocmd/link: fix confusing error on unresolved symbol
Austin Clements [Mon, 28 Jan 2019 02:03:32 +0000 (21:03 -0500)]
cmd/link: fix confusing error on unresolved symbol

Currently, if an assembly file includes a static reference to an
undefined symbol, and another package also has an undefined reference
to that symbol, the linker can report an error like:

  x: relocation target zero not defined for ABI0 (but is defined for ABI0)

Since the symbol is referenced in another package, the code in
ErrorUnresolved that looks for alternative ABI symbols finds that
symbol in the symbol table, but doesn't check that it's actually
defined, which is where the "but is defined for ABI0" comes from. The
"not defined for ABI0" is because ErrorUnresolved failed to turn the
static symbol's version back into an ABI, and it happened to print the
zero value for an ABI.

This CL fixes both of these problems. It explicitly maps the
relocation version back to an ABI and detects if it can't be mapped
back (e.g., because it's a static reference). Then, if it finds a
symbol with a different ABI in the symbol table, it checks to make
sure it's a definition, and not simply an unresolved reference.

Fixes #29852.

Change-Id: Ice45cc41c1907919ce5750f74588e8047eaa888c
Reviewed-on: https://go-review.googlesource.com/c/159518
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc: mention init traceback change in Go 1.12 release notes
Ian Lance Taylor [Mon, 28 Jan 2019 18:45:26 +0000 (10:45 -0800)]
doc: mention init traceback change in Go 1.12 release notes

Updates #29919

Change-Id: Ibf92c9957f71394f08c1203a29eae35a12021585
Reviewed-on: https://go-review.googlesource.com/c/159877
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agodoc: describe change to eliminate method expression wrappers from stack traces
Keith Randall [Tue, 22 Jan 2019 21:44:32 +0000 (13:44 -0800)]
doc: describe change to eliminate method expression wrappers from stack traces

Change-Id: I824b42a1c1fdcee8712681ffc6316470761be065
Reviewed-on: https://go-review.googlesource.com/c/159858
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agopath/filepath: skip TestIssue29372 on windows, if /tmp has symilinks
Alex Brainman [Fri, 25 Jan 2019 07:22:27 +0000 (18:22 +1100)]
path/filepath: skip TestIssue29372 on windows, if /tmp has symilinks

TestIssue29372 is broken on windows when temporary directory has
symlink in its path.

Adjust the test to use filepath.EvalSymlinks of temporary directory,
instead of temporary directory on windows. This change is not a
proper fix, but at least it makes TestIssue29372 pass on windows-arm.

See issue for details.

Updates #29746

Change-Id: I2af8ebb89da7cb9daf027a5e49e32ee22dbd0e3d
Reviewed-on: https://go-review.googlesource.com/c/159578
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/compile: hide init functions in tracebacks
Keith Randall [Fri, 25 Jan 2019 18:21:40 +0000 (10:21 -0800)]
cmd/compile: hide init functions in tracebacks

Treat compiler-generated init functions as wrappers, so they will not
be shown in tracebacks.

The exception to this rule is that we'd like to show the line number
of initializers for global variables in tracebacks. In order to
preserve line numbers for those cases, separate out the code for those
initializers into a separate function (which is not marked as
autogenerated).

This CL makes the go binary 0.2% bigger.

Fixes #29919

Change-Id: I0f1fbfc03d10d764ce3a8ddb48fb387ca8453386
Reviewed-on: https://go-review.googlesource.com/c/159717
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/compile: base PPC64 trunc rules on final type, not op type
Ian Lance Taylor [Sat, 26 Jan 2019 19:55:00 +0000 (11:55 -0800)]
cmd/compile: base PPC64 trunc rules on final type, not op type

Whether a truncation should become a MOVWreg or a MOVWZreg doesn't
depend on the type of the operand, it depends on the type of the final
result.  If the final result is unsigned, we can use MOVWZreg.  If the
final result is signed, we can use MOVWreg.  Checking the type of the
operand does the wrong thing if truncating an unsigned value to a
signed value, or vice-versa.

Fixes #29943

Change-Id: Ia6fc7d006486fa02cffd0bec4d910bdd5b6365f8
Reviewed-on: https://go-review.googlesource.com/c/159760
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agosort: change let to let's
GiantsLoveDeathMetal [Fri, 25 Jan 2019 02:07:03 +0000 (02:07 +0000)]
sort: change let to let's

Trivial typo

Change-Id: I3804f365519453bfa19997f55ead34742ac1a9db
GitHub-Last-Rev: 0e04e928d05121099b78a2cefc1cb7531f6a7650
GitHub-Pull-Request: golang/go#29930
Reviewed-on: https://go-review.googlesource.com/c/159479
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
5 years agocmd/go: mention that binary packages are going away
Ian Lance Taylor [Fri, 25 Jan 2019 02:36:00 +0000 (18:36 -0800)]
cmd/go: mention that binary packages are going away

Updates #28152
Fixes #29927

Change-Id: Iea692c90074d057a1733e98bca3928e8f3569585
Reviewed-on: https://go-review.googlesource.com/c/159557
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/compile, cmd/link: document more flags
yo-tak [Tue, 22 Jan 2019 15:11:33 +0000 (00:11 +0900)]
cmd/compile, cmd/link: document more flags

Fixes #26533

Change-Id: I5a48d667d474f3f222f9055e51131561a0cf45b6
Reviewed-on: https://go-review.googlesource.com/c/138757
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/go/internal/modload: ensure that __debug_modinfo__ is not discarded during linking
Bryan C. Mills [Thu, 17 Jan 2019 19:39:31 +0000 (14:39 -0500)]
cmd/go/internal/modload: ensure that __debug_modinfo__ is not discarded during linking

Fixes #28753
Updates #29628

Change-Id: I4a561be7d491a0d088e656b00151ae1bdbd16a84
Reviewed-on: https://go-review.googlesource.com/c/158357
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agocrypto/elliptic: reduce subtraction term to prevent long busy loop
Filippo Valsorda [Tue, 22 Jan 2019 21:02:41 +0000 (16:02 -0500)]
crypto/elliptic: reduce subtraction term to prevent long busy loop

If beta8 is unusually large, the addition loop might take a very long
time to bring x3-beta8 back positive.

This would lead to a DoS vulnerability in the implementation of the
P-521 and P-384 elliptic curves that may let an attacker craft inputs
to ScalarMult that consume excessive amounts of CPU.

This fixes CVE-2019-6486.

Fixes #29903

Change-Id: Ia969e8b5bf5ac4071a00722de9d5e4d856d8071a
Reviewed-on: https://team-review.git.corp.google.com/c/399777
Reviewed-by: Adam Langley <agl@google.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
Reviewed-on: https://go-review.googlesource.com/c/159218
Reviewed-by: Julie Qiu <julie@golang.org>
5 years agonet/http: update bundled http2
Brad Fitzpatrick [Wed, 23 Jan 2019 20:35:37 +0000 (20:35 +0000)]
net/http: update bundled http2

Updates bundled http2 to x/net git rev ed066c81e7 for:

    http2: Revert a closed stream cannot receive data
    https://golang.org/cl/153977

Updates golang/go#28204

Change-Id: I0a489e4e8a581a107970199f64f0fa9281982efe
Reviewed-on: https://go-review.googlesource.com/c/159179
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years agonet/url, net/http: reject control characters in URLs
Brad Fitzpatrick [Wed, 23 Jan 2019 19:09:07 +0000 (19:09 +0000)]
net/url, net/http: reject control characters in URLs

This is a more conservative version of the reverted CL 99135 (which
was reverted in CL 137716)

The net/url part rejects URLs with ASCII CTLs from being parsed and
the net/http part rejects writing them if a bogus url.URL is
constructed otherwise.

Updates #27302
Updates #22907

Change-Id: I09a2212eb74c63db575223277aec363c55421ed8
Reviewed-on: https://go-review.googlesource.com/c/159157
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
5 years agodoc: mention 'go get golang.org/dl/...' in install
Daniel Martí [Thu, 10 Jan 2019 23:42:53 +0000 (23:42 +0000)]
doc: mention 'go get golang.org/dl/...' in install

I needed Go 1.10 to debug and fix a test failure on that Go version in
x/tools, but I forgot what the magic 'go get' command for this was.

Googling "download specific golang version" and similar keywords showed
no results, presumably because the golang.org/dl subrepo isn't
prominently recommended nor documented anywhere.

The most appropriate documentation page to add this to is doc/install,
since it goes into some detail and is well indexed. We only need a short
section to introduce the trick.

The example does mention a specific version, Go 1.10.7, but I couldn't
imagine a way to make it version-agnostic while still being clear on
what the commands effectively do.

Change-Id: I13158564d76d95caec412cdb35a50a4356df5863
Reviewed-on: https://go-review.googlesource.com/c/157457
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
5 years agoA+C: change email address for Elias Naur
Elias Naur [Wed, 23 Jan 2019 14:05:16 +0000 (15:05 +0100)]
A+C: change email address for Elias Naur

Change-Id: I0eefaed645d5d1f56c408af496c92dbb799977c8
Reviewed-on: https://go-review.googlesource.com/c/159037
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/compile: don't bother compiling functions named "_"
Keith Randall [Tue, 22 Jan 2019 21:49:47 +0000 (13:49 -0800)]
cmd/compile: don't bother compiling functions named "_"

They can't be used, so we don't need code generated for them. We just
need to report errors in their bodies.

This is the minimal CL for 1.12. For 1.13, CL 158845 will remove
a bunch of special cases sprinkled about the compiler to handle "_"
functions, which should (after this CL) be unnecessary.

Update #29870

Change-Id: Iaa1c194bd0017dffdce86589fe2d36726ee83c13
Reviewed-on: https://go-review.googlesource.com/c/158820
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocrypto/subtle: normalize constant time ops docs
Filippo Valsorda [Sun, 20 Jan 2019 21:18:04 +0000 (16:18 -0500)]
crypto/subtle: normalize constant time ops docs

ConstantTimeCompare is fairly useless if you can't rely on it being zero
when the slices are different, but thankfully it has that property
thanks to the final ConstantTimeByteEq.

Change-Id: Id51100ed7d8237abbbb15778a259065b162a48ad
Reviewed-on: https://go-review.googlesource.com/c/158643
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
5 years agocmd/go: copy missing bit of documentation about code generated comment
Dmitri Shuralyov [Mon, 21 Jan 2019 18:50:22 +0000 (13:50 -0500)]
cmd/go: copy missing bit of documentation about code generated comment

This CL attempts to restore the clarity of the original specification
at https://golang.org/s/generatedcode that the line may appear
anywhere. It is preferable (for human readability), and most common
for it to be early in the file, but that is merely a convention, not
a strict well-specified requirement. Document it as so.

Background

Issue #13560 was a proposal define a standard for marking files as
generated, one that is suitable to be recognized both by humans
and machine tools. It was accepted, and the final specification
was documented at https://golang.org/s/generatedcode. Its text,
copied exactly:

Generated files are marked by a line of text that matches
the regular expression, in Go syntax:

^// Code generated .* DO NOT EDIT\.$

The .* means the tool can put whatever folderol it wants in there,
but the comment must be a single line and must start with Code generated
and end with DO NOT EDIT., with a period.

The text may appear anywhere in the file.

The https://golang.org/s/generatedcode link points to a comment
in a very large GitHub issue. That makes it harder to find.
Issue #25433 was opened about moving that information somewhere else.
It was resolved via CL 118756, which added text to cmd/go documentation
at https://golang.org/cmd/go/#hdr-Generate_Go_files_by_processing_source:

To convey to humans and machine tools that code is generated,
generated source should have a line early in the file that
matches the following regular expression (in Go syntax):

^// Code generated .* DO NOT EDIT\.$

The CL description noted that "This change merely moves that
information to a more visible place." The intention was to preserve
the specification unmodified.

The original specification was very clear that "The text may appear
anywhere in the file." The new text in cmd/go documentation wasn't
very clear. "A line early in the file" is not a precise enough criteria
to be recognized by a machine tool, because there isn't a precise
definition of what lines are "early in the file".

Updates #13560
Updates #25433
Updates #28089

Change-Id: I4e374163b16c3f972f9591ec2647fd3d5a2dd5ae
Reviewed-on: https://go-review.googlesource.com/c/158817
Reviewed-by: Rob Pike <r@golang.org>
5 years agodoc/go1.12.html: document rejection of mangled C names
Elias Naur [Mon, 21 Jan 2019 15:12:46 +0000 (16:12 +0100)]
doc/go1.12.html: document rejection of mangled C names

Change-Id: I27ef49815f55a36379b730b77f7e9a4dd5341507
Reviewed-on: https://go-review.googlesource.com/c/158777
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/cgo: remove duplicate entry from gofmtLineReplacer
Tobias Klauser [Sun, 20 Jan 2019 18:14:58 +0000 (19:14 +0100)]
cmd/cgo: remove duplicate entry from gofmtLineReplacer

CL 158457 added a duplicate entry for the ",\n" -> "," replacement to
gofmtLineReplacer. Remove the duplicate.

Change-Id: I17684fcd19cbc96fa7a7b53bf7c1a6382bf1114f
Reviewed-on: https://go-review.googlesource.com/c/158619
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agoflag: improve docs for PrintDefaults; clarify how to change output destination
Aaron Cannon [Sat, 27 Oct 2018 16:21:00 +0000 (11:21 -0500)]
flag: improve docs for PrintDefaults; clarify how to change output destination

The existing docs only mention that it is possible to change the output
destination of PrintDefaults from the default of standard error, but fail to
mention how to actually do so. This change fixes this lack by directing users
to CommandLine.SetOutput.

Fixes #15024

Change-Id: Ieaa7edbebd23d4ea6fa7e53d97a87143d590bdb3
Reviewed-on: https://go-review.googlesource.com/c/145203
Reviewed-by: Rob Pike <r@golang.org>
5 years agocrypto/tls: send a "handshake failure" alert if the RSA key is too small
Filippo Valsorda [Fri, 18 Jan 2019 22:33:49 +0000 (17:33 -0500)]
crypto/tls: send a "handshake failure" alert if the RSA key is too small

Fixes #29779

Change-Id: I7eb8b4db187597e07d8ec7d3ff651f008e2ca433
Reviewed-on: https://go-review.googlesource.com/c/158639
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/cgo: print the right error if mangling detection gccgo fails
Ian Lance Taylor [Sun, 20 Jan 2019 15:46:18 +0000 (07:46 -0800)]
cmd/cgo: print the right error if mangling detection gccgo fails

Change-Id: I2324f6f51d2bf8a4ae1b139b3933bc78dfa75835
Reviewed-on: https://go-review.googlesource.com/c/158718
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years agodoc/go1.12: mention small RSA keys will cause some TLS handshakes to fail
Filippo Valsorda [Fri, 18 Jan 2019 22:32:30 +0000 (17:32 -0500)]
doc/go1.12: mention small RSA keys will cause some TLS handshakes to fail

Updates #29779

Change-Id: I9becaba41ab4cd0bac25b4bedf3f8b19761d8158
Reviewed-on: https://go-review.googlesource.com/c/158638
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocrypto/tls: expand Config.CipherSuites docs
Filippo Valsorda [Fri, 18 Jan 2019 22:31:45 +0000 (17:31 -0500)]
crypto/tls: expand Config.CipherSuites docs

Fixes #29349

Change-Id: Iec16eb2b20b43250249ec85c3d78fd64d1b6e3f3
Reviewed-on: https://go-review.googlesource.com/c/158637
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodoc/go1.12: mention heap sampling change
Hana (Hyang-Ah) Kim [Fri, 18 Jan 2019 19:45:25 +0000 (14:45 -0500)]
doc/go1.12: mention heap sampling change

This is about a minor change but worthy of note because this
may affect the profile results users will see.

Change-Id: Ie2c4358b248f868662dbc71db587576481aa7238
Reviewed-on: https://go-review.googlesource.com/c/158577
Reviewed-by: Raul Silvera <rauls5382@gmail.com>
Reviewed-by: Austin Clements <austin@google.com>
5 years agoA+C: add author, rename contributor to a real name
tkivisik [Fri, 18 Jan 2019 20:45:41 +0000 (20:45 +0000)]
A+C: add author, rename contributor to a real name

Renamed from github user to use my real name in CONTRIBUTORS, added my name
to AUTHORS.

Change-Id: I671638f1525d44bcc2b0a08d0dcff6adb1717510
GitHub-Last-Rev: b989e185de9ad2d1207085043fcdc821d851c562
GitHub-Pull-Request: golang/go#29823
Reviewed-on: https://go-review.googlesource.com/c/158540
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agoruntime: sample large heap allocations correctly
Raul Silvera [Fri, 18 Jan 2019 00:14:29 +0000 (00:14 +0000)]
runtime: sample large heap allocations correctly

Remove an unnecessary check on the heap sampling code that forced sampling
of all heap allocations larger than the sampling rate. This need to follow
a poisson process so that they can be correctly unsampled. Maintain a check
for MemProfileRate==1 to provide a mechanism for full sampling, as
documented in https://golang.org/pkg/runtime/#pkg-variables.

Additional testing for this change is on cl/129117.

Fixes #26618

Change-Id: I7802bde2afc655cf42cffac34af9bafeb3361957
GitHub-Last-Rev: 471f747af845395d458096bea26daa93b91120be
GitHub-Pull-Request: golang/go#29791
Reviewed-on: https://go-review.googlesource.com/c/158337
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
5 years agocmd/go: don't modify GOROOT in TestNewReleaseRebuildsStalePackagesInGOPATH
Ian Lance Taylor [Mon, 17 Dec 2018 00:06:13 +0000 (16:06 -0800)]
cmd/go: don't modify GOROOT in TestNewReleaseRebuildsStalePackagesInGOPATH

Fixes #29263

Change-Id: I06ba135dc491fd01fc06ccaad4ef98103d4b86c4
Reviewed-on: https://go-review.googlesource.com/c/154460
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/cgo: don't replace newlines with semicolons in expressions
Ian Lance Taylor [Fri, 18 Jan 2019 02:35:43 +0000 (18:35 -0800)]
cmd/cgo: don't replace newlines with semicolons in expressions

Fixes #29781

Change-Id: Id032d07a54b8c24f0c6d3f6e512932f76920ee04
Reviewed-on: https://go-review.googlesource.com/c/158457
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agonet/http: clarify Transport connection reuse docs a bit
Brad Fitzpatrick [Thu, 17 Jan 2019 23:22:47 +0000 (15:22 -0800)]
net/http: clarify Transport connection reuse docs a bit

Updates #26095 (or fixes it)

Change-Id: I92488dabe823b82e1ba534648fe6d63d25d0ae9f
Reviewed-on: https://go-review.googlesource.com/c/158417
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agomath/big: document that Rat.SetString accepts _decimal_ float representations
Robert Griesemer [Thu, 17 Jan 2019 22:49:30 +0000 (14:49 -0800)]
math/big: document that Rat.SetString accepts _decimal_ float representations

Updates #29799.

Change-Id: I267c2c3ba3964e96903954affc248d0c52c4916c
Reviewed-on: https://go-review.googlesource.com/c/158397
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agoruntime: don't coalesce scavenged spans with unscavenged spans
Michael Anthony Knyszek [Wed, 16 Jan 2019 00:15:34 +0000 (00:15 +0000)]
runtime: don't coalesce scavenged spans with unscavenged spans

As a result of changes earlier in Go 1.12, the scavenger became much
more aggressive. In particular, when scavenged and unscavenged spans
coalesced, they would always become scavenged. This resulted in most
spans becoming scavenged over time. While this is good for keeping the
RSS of the program low, it also causes many more undue page faults and
many more calls to madvise.

For most applications, the impact of this was negligible. But for
applications that repeatedly grow and shrink the heap by large amounts,
the overhead can be significant. The overhead was especially obvious on
older versions of Linux where MADV_FREE isn't available and
MADV_DONTNEED must be used.

This change makes it so that scavenged spans will never coalesce with
unscavenged spans. This  results in fewer page faults overall. Aside
from this, the expected impact of this change is more heap growths on
average, as span allocations will be less likely to be fulfilled. To
mitigate this slightly, this change also coalesces spans eagerly after
scavenging, to at least ensure that all scavenged spans and all
unscavenged spans are coalesced with each other.

Also, this change adds additional logic in the case where two adjacent
spans cannot coalesce. In this case, on platforms where the physical
page size is larger than the runtime's page size, we realign the
boundary between the two adjacent spans to a physical page boundary. The
advantage of this approach is that "unscavengable" spans, that is, spans
which cannot be scavenged because they don't cover at least a single
physical page are grown to a size where they have a higher likelihood of
being discovered by the runtime's scavenging mechanisms when they border
a scavenged span. This helps prevent the runtime from accruing pockets
of "unscavengable" memory in between scavenged spans, preventing them
from coalescing.

We specifically choose to apply this logic to all spans because it
simplifies the code, even though it isn't strictly necessary. The
expectation is that this change will result in a slight loss in
performance on platforms where the physical page size is larger than the
runtime page size.

Update #14045.

Change-Id: I64fd43eac1d6de6f51d7a2ecb72670f10bb12589
Reviewed-on: https://go-review.googlesource.com/c/158078
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
5 years agoruntime: de-duplicate coalescing code
Michael Anthony Knyszek [Tue, 15 Jan 2019 23:48:57 +0000 (23:48 +0000)]
runtime: de-duplicate coalescing code

Currently the code surrounding coalescing is duplicated between merging
with the span before the span considered for coalescing and merging with
the span after. This change factors out the shared portions of these
codepaths into a local closure which acts as a helper.

Change-Id: I7919fbed3f9a833eafb324a21a4beaa81f2eaa91
Reviewed-on: https://go-review.googlesource.com/c/158077
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
5 years agoruntime: refactor coalescing into its own method
Michael Anthony Knyszek [Mon, 14 Jan 2019 21:27:29 +0000 (21:27 +0000)]
runtime: refactor coalescing into its own method

The coalescing process is complex and in a follow-up change we'll need
to do it in more than one place, so this change factors out the
coalescing code in freeSpanLocked into a method on mheap.

Change-Id: Ia266b6cb1157c1b8d3d8a4287b42fbcc032bbf3a
Reviewed-on: https://go-review.googlesource.com/c/157838
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
5 years agodoc/go1.12: link to ABIInternal design document
Austin Clements [Thu, 17 Jan 2019 02:42:00 +0000 (21:42 -0500)]
doc/go1.12: link to ABIInternal design document

The ABI changes should be completely transparent to Go code, but could
cause linking issues in certain situations involving assembly code
reaching across package boundaries. If users encounter linking
problems, point them to the "Compatibility" section of the ABI design
document, which gives some guidance.

Change-Id: I4156d164562e2ec0de7ae8f9a3631a32ec45b317
Reviewed-on: https://go-review.googlesource.com/c/158237
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agotesting: report the failing test in a late log panic
Ian Lance Taylor [Fri, 11 Jan 2019 22:06:45 +0000 (14:06 -0800)]
testing: report the failing test in a late log panic

Updates #29388

Change-Id: Icb0e6048d05fde7a5486b923ff62147edb5c8dac
Reviewed-on: https://go-review.googlesource.com/c/157617
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
5 years agonet: increase TestNotTemporaryRead server sleep
Clément Chigot [Wed, 16 Jan 2019 08:03:57 +0000 (09:03 +0100)]
net: increase TestNotTemporaryRead server sleep

On aix/ppc64, if the server closes before the client calls Accept,
this test will fail.

Increasing the time before the server closes should resolve this
timeout.

Updates #29685

Change-Id: Iebb849d694fc9c37cf216ce1f0b8741249b98016
Reviewed-on: https://go-review.googlesource.com/c/158038
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/go/internal/clean: fix clean -testcache does not clean test cache
Baokun Lee [Wed, 16 Jan 2019 10:53:35 +0000 (18:53 +0800)]
cmd/go/internal/clean: fix clean -testcache does not clean test cache

Truncate changes the size of the file. It does not change the I/O offset.

Fixes #29757

Change-Id: I1aa9223a86d6a8ce3c0efc3ac1d7d7647b77f589
Reviewed-on: https://go-review.googlesource.com/c/158117
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agoencoding/json: add comment for mashalererror struct
GuilhermeCaruso [Tue, 15 Jan 2019 23:24:52 +0000 (23:24 +0000)]
encoding/json: add comment for mashalererror struct

Change-Id: Iaabbfe5a4c1bbedd19d4087f1b79e5a38bdd3878
GitHub-Last-Rev: 55c91fc19074dacc66623aa7ff2286b11ccd5340
GitHub-Pull-Request: golang/go#29752
Reviewed-on: https://go-review.googlesource.com/c/157958
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/go: fix wording issue in comment
Daniel Martí [Tue, 15 Jan 2019 18:29:15 +0000 (18:29 +0000)]
cmd/go: fix wording issue in comment

golang.org/cl/157097 modified this comment, but left a trailing comma.
While at it, make the sentence a bit clearer.

Change-Id: I376dda4fd18ddbcae4485dd660a79b9f66ad6da4
Reviewed-on: https://go-review.googlesource.com/c/158037
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/cgo: don't replace newlines with semicolons in composite literals
Ian Lance Taylor [Tue, 15 Jan 2019 15:46:39 +0000 (07:46 -0800)]
cmd/cgo: don't replace newlines with semicolons in composite literals

Fixes #29748

Change-Id: I2b19165bdb3c99df5b79574390b5d5f6d40462dc
Reviewed-on: https://go-review.googlesource.com/c/157961
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go: remove init() to fix precedence issue when setting debug mod info
Viacheslav Poturaev [Wed, 9 Jan 2019 12:54:50 +0000 (12:54 +0000)]
cmd/go: remove init() to fix precedence issue when setting debug mod info

Fixes #29628

Change-Id: I95dabed797ef7a1a770b6f4219840f653306af7e
GitHub-Last-Rev: 9275dd8f1c6a0cfa16ae882fcfc100991f8338f7
GitHub-Pull-Request: golang/go#29630
Reviewed-on: https://go-review.googlesource.com/c/157097
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agopath/filepath: skip part of TestNTNamespaceSymlink
Alex Brainman [Tue, 15 Jan 2019 08:37:17 +0000 (19:37 +1100)]
path/filepath: skip part of TestNTNamespaceSymlink

Recent CL 156398 extended TestNTNamespaceSymlink. But new code
fails, if user running the test does not have sufficient privilege
to create file symlink. Skip part of TestNTNamespaceSymlink, if
user cannot create symlink.

Fixes #29745

Change-Id: Ie4176429ba9dd98553ce9e91fd19851cc7353f42
Reviewed-on: https://go-review.googlesource.com/c/157917
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
5 years agoruntime: keep FuncForPC from crashing for PCs between functions
Keith Randall [Mon, 14 Jan 2019 21:47:14 +0000 (13:47 -0800)]
runtime: keep FuncForPC from crashing for PCs between functions

Reuse the strict mechanism from FileLine for FuncForPC, so we don't
crash when asking the pcln table about bad pcs.

Fixes #29735

Change-Id: Iaffb32498b8586ecf4eae03823e8aecef841aa68
Reviewed-on: https://go-review.googlesource.com/c/157799
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agomisc/sortac: delete sortac command
Dmitri Shuralyov [Thu, 10 Jan 2019 02:01:41 +0000 (21:01 -0500)]
misc/sortac: delete sortac command

The sortac command is no longer needed as of CL 157238, and
can be deleted. Its functionality has been directly integrated
into the new x/build/cmd/updatecontrib command. A previous version
of updatecontrib was the only user of sortac.

Updates #12042

Change-Id: If7442ebee11d05d095ff875a37eed3973c0fd9ca
Reviewed-on: https://go-review.googlesource.com/c/157257
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/compile: when merging instructions, prefer line number of faulting insn
Keith Randall [Tue, 8 Jan 2019 21:46:49 +0000 (13:46 -0800)]
cmd/compile: when merging instructions, prefer line number of faulting insn

Normally this happens when combining a sign extension and a load.  We
want the resulting combo-instruction to get the line number of the
load, not the line number of the sign extension.

For each rule, compute where we should get its line number by finding
a value on the match side that can fault.  Use that line number for
all the new values created on the right-hand side.

Fixes #27201

Change-Id: I19b3c6f468fff1a3c0bfbce2d6581828557064a3
Reviewed-on: https://go-review.googlesource.com/c/156937
Reviewed-by: David Chase <drchase@google.com>
5 years agodatabase/sql: fix logic for pulling a Conn from DB
Daniel Theophanes [Fri, 11 Jan 2019 22:20:41 +0000 (14:20 -0800)]
database/sql: fix logic for pulling a Conn from DB

The logic for pulling a database connection from the DB pool should
proceed as follows: attempt to pull either a cached connection or
new connection N times in a loop. If each connection results
in a bad connection, then create a new connection (no cache).

Previously pulling a Conn from the pool, the last step also
looked at the cache, rather then always creating a new connection.

Fixes #29684

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

5 years agonet: skip TestLookupGmailTXT on Plan 9
David du Colombier [Sun, 13 Jan 2019 21:11:44 +0000 (22:11 +0100)]
net: skip TestLookupGmailTXT on Plan 9

CL 157638 updated TestLookupGmailTXT. However, this
test is failing on Plan 9, because the DNS resolver
(ndb/dns) only returns a single TXT record.

Updates #29722.

Change-Id: I01cd94e6167902361c3f5d615868f6f763a31fb1
Reviewed-on: https://go-review.googlesource.com/c/157737
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agonet: pass if at least one matching entry in TestLookupGmailTXT
Ian Lance Taylor [Fri, 11 Jan 2019 22:26:24 +0000 (14:26 -0800)]
net: pass if at least one matching entry in TestLookupGmailTXT

Fixes #29698

Change-Id: I0531c0a274b120af8871aa2f5975744ff6c912a3
Reviewed-on: https://go-review.googlesource.com/c/157638
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go: remove note about GOCACHE=off in docs
Sebastiaan van Stijn [Fri, 11 Jan 2019 15:28:04 +0000 (15:28 +0000)]
cmd/go: remove note about GOCACHE=off in docs

This patch removes mention of GOCACHE=off from the help/docs.
It is no longer supported in Go 1.12, per the release notes.

Fixes #29680

Change-Id: I53ab15a62743f2e55ae1d8aa50629b1bf1ae32ad
GitHub-Last-Rev: 31e904f51dece13645696a87b1164d86c984457f
GitHub-Pull-Request: golang/go#29681
Reviewed-on: https://go-review.googlesource.com/c/157517
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/compile: separate data and function LSyms
Austin Clements [Wed, 9 Jan 2019 03:23:52 +0000 (22:23 -0500)]
cmd/compile: separate data and function LSyms

Currently, obj.Ctxt's symbol table does not distinguish between ABI0
and ABIInternal symbols. This is *almost* okay, since a given symbol
name in the final object file is only going to belong to one ABI or
the other, but it requires that the compiler mark a Sym as being a
function symbol before it retrieves its LSym. If it retrieves the LSym
first, that LSym will be created as ABI0, and later marking the Sym as
a function symbol won't change the LSym's ABI.

Marking a Sym as a function symbol before looking up its LSym sounds
easy, except Syms have a dual purpose: they are used just as interned
strings (every function, variable, parameter, etc with the same
textual name shares a Sym), and *also* to store state for whatever
package global has that name. As a result, it's easy to slip up and
look up an LSym when a Sym is serving as the name of a local variable,
and then later mark it as a function when it's serving as the global
with the name.

In general, we were careful to avoid this, but #29610 demonstrates one
case where we messed up. Because of on-demand importing from indexed
export data, it's possible to compile a method wrapper for a type
imported from another package before importing an init function from
that package. If the argument of the method is named "init", the
"init" LSym will be created as a data symbol when compiling the
wrapper, before it gets marked as a function symbol.

To fix this, we separate obj.Ctxt's symbol tables for ABI0 and
ABIInternal symbols. This way, the compiler will simply get a
different LSym once the Sym takes on its package-global meaning as a
function.

This fixes the above ordering issue, and means we no longer need to go
out of our way to create the "init" function early and mark it as a
function symbol.

Fixes #29610.
Updates #27539.

Change-Id: Id9458b40017893d46ef9e4a3f9b47fc49e1ce8df
Reviewed-on: https://go-review.googlesource.com/c/157017
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
5 years agodoc: add Go 1.12 release note for trigonometric reductions in math
Ian Lance Taylor [Thu, 10 Jan 2019 19:12:28 +0000 (11:12 -0800)]
doc: add Go 1.12 release note for trigonometric reductions in math

Worth mentioning because the results are not bit-for-bit identical.
This causes a test failure in github.com/fogleman/gg.

Updates #6794

Change-Id: I701f34927731fb5c658a1be271c04388e5e7e3f7
Reviewed-on: https://go-review.googlesource.com/c/157417
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agoruntime: make mTreap iterator bidirectional go1.12beta2
Michael Anthony Knyszek [Fri, 4 Jan 2019 20:17:15 +0000 (20:17 +0000)]
runtime: make mTreap iterator bidirectional

This change makes mTreap's iterator type, treapIter, bidirectional
instead of unidirectional. This change helps support moving the find
operation on a treap to return an iterator instead of a treapNode, in
order to hide the details of the treap when accessing elements.

For #28479.

Change-Id: I5dbea4fd4fb9bede6e81bfd089f2368886f98943
Reviewed-on: https://go-review.googlesource.com/c/156918
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agopath/filepath: return special error from EvalSymlinks
Alex Brainman [Sat, 5 Jan 2019 07:35:27 +0000 (18:35 +1100)]
path/filepath: return special error from EvalSymlinks

CL 155597 attempted to fix #29372. But it failed to make all new
test cases pass. Also CL 155597 broke some existing code
(see #29449 for details).

Make small adjustment to CL 155597 that fixes both #29372 and #29449.

Suggested by Ian.

Updates #29372
Fixes #29449

Change-Id: I9777a615514d3f152af5acb65fb1239e696607b6
Reviewed-on: https://go-review.googlesource.com/c/156398
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agonet: drop confusing comment
Mikio Hara [Wed, 9 Jan 2019 20:14:40 +0000 (05:14 +0900)]
net: drop confusing comment

On AIX, we don't need to be aware of any change on the protocol stack of
Linux kernel.

Change-Id: Ib8b14fa930acddb3bc720d401271e8daf567b784
Reviewed-on: https://go-review.googlesource.com/c/157298
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agonet: update BUG sections for go1.12
Mikio Hara [Wed, 9 Jan 2019 20:14:40 +0000 (05:14 +0900)]
net: update BUG sections for go1.12

To confirm this change with the go commaned, please run 'go doc net'
instead of 'go doc -all net'; the -all option surpresses BUG sections.

Change-Id: Iac7bc85fbef48e91d5ede16da0ce4a7ab8cae539
Reviewed-on: https://go-review.googlesource.com/c/157297
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/dist, cmd/link, runtime: fix stack size when cross-compiling aix/ppc64
Clément Chigot [Wed, 9 Jan 2019 13:05:17 +0000 (14:05 +0100)]
cmd/dist, cmd/link, runtime: fix stack size when cross-compiling aix/ppc64

This commit allows to cross-compiling aix/ppc64. The nosplit limit must
twice as large as on others platforms because of AIX syscalls.
The stack limit, especially stackGuardMultiplier, was set by cmd/dist
during the bootstrap and doesn't depend on GOOS/GOARCH target.

Fixes #29572

Change-Id: Id51e38885e1978d981aa9e14972eaec17294322e
Reviewed-on: https://go-review.googlesource.com/c/157117
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agoos: always treat files as unpollable on FreeBSD
Ian Lance Taylor [Wed, 9 Jan 2019 18:04:58 +0000 (10:04 -0800)]
os: always treat files as unpollable on FreeBSD

Fixes #29633
Updates #27619

Change-Id: I1e38569ea2a02423b028331f2ed987d3ae47fd2e
Reviewed-on: https://go-review.googlesource.com/c/157099
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/go: skip tests using Git on Plan 9
David du Colombier [Wed, 9 Jan 2019 20:32:11 +0000 (21:32 +0100)]
cmd/go: skip tests using Git on Plan 9

TestScript/get_unicode, TestScript/get_dotfiles and
TestScript/get_brace are failing on Plan 9 since they
expect a full-featured git command, while the git tool
has been emulated as a simple rc script on Plan 9.

This change skips tests using Git on Plan 9.

Fixes #29640.

Change-Id: Id7f6fdca552167f4631fe401f63167e5653daafa
Reviewed-on: https://go-review.googlesource.com/c/157119
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/internal/obj/wasm: increment PC by 2 at sigpanic
Cherry Zhang [Wed, 9 Jan 2019 16:21:07 +0000 (11:21 -0500)]
cmd/internal/obj/wasm: increment PC by 2 at sigpanic

On Wasm, PC is not the instruction counter but the block ID. We
advance the PC only when necessary. In the case of sigpanic (used
in nil check), the panic stack trace expects the PC at the call
of sigpanic, not the next one. However, runtime.Caller subtracts
1 from the PC. To make both PC and PC-1 work (have the same line
number), we advance the PC by 2 at sigpanic.

Fixes #29632.

Change-Id: Ieb4d0bb9dc6a8103855a194e3d289f1db4bfb1e5
Reviewed-on: https://go-review.googlesource.com/c/157157
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Richard Musiol <neelance@gmail.com>
Run-TryBot: Richard Musiol <neelance@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agogo/types: don't create new context string for each argument of each call
Robert Griesemer [Wed, 9 Jan 2019 06:39:13 +0000 (22:39 -0800)]
go/types: don't create new context string for each argument of each call

The argument context string is only used in error messages. Don't format
the function AST into a string for every single argument of every single
call that is type-checked. Instead do it once per call (still not great,
but much much better).

Performance optimization.

Change-Id: Iec87f9ad34128d7b3eee58577ad37dbaa8e6db44
Reviewed-on: https://go-review.googlesource.com/c/157037
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agonet/http/httputil: run the ReverseProxy.ModifyResponse hook for upgrades
Brad Fitzpatrick [Wed, 9 Jan 2019 15:06:20 +0000 (15:06 +0000)]
net/http/httputil: run the ReverseProxy.ModifyResponse hook for upgrades

Fixes #29627

Change-Id: I08a5b45151a11b5a4f3b5a2d984c0322cf904697
Reviewed-on: https://go-review.googlesource.com/c/157098
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agonet/http/httputil: fix typo in ReverseProxy godoc
Tobias Klauser [Wed, 9 Jan 2019 13:24:44 +0000 (14:24 +0100)]
net/http/httputil: fix typo in ReverseProxy godoc

Change-Id: Iea33fe64403ca2e6f87a4e070af5e97d96506e41
Reviewed-on: https://go-review.googlesource.com/c/157118
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodebug/gosym: remove outdated comment
LE Manh Cuong [Wed, 9 Jan 2019 02:27:54 +0000 (09:27 +0700)]
debug/gosym: remove outdated comment

Change-Id: I2bba13064c8d21ded41499c6ec225ef83d1a533e
Reviewed-on: https://go-review.googlesource.com/c/156997
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agoruntime: follow convention for generated code comment in fastlog2table
Tobias Klauser [Tue, 8 Jan 2019 13:14:27 +0000 (14:14 +0100)]
runtime: follow convention for generated code comment in fastlog2table

Follow the convertion (https://golang.org/s/generatedcode) for generated
code in fastlog2table.go

Change-Id: Ib40ae2848924d98afaf8d4fcaf180a4583edc3fe
Reviewed-on: https://go-review.googlesource.com/c/156817
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agoos: disable the use of netpoll on regular files on *BSDs.
Yuval Pavel Zholkover [Mon, 7 Jan 2019 00:06:38 +0000 (02:06 +0200)]
os: disable the use of netpoll on regular files on *BSDs.

The kqueue based netpoller always registers file descriptors with EVFILT_READ and EVFILT_WRITE.
However only EVFILT_READ notification is supported for regular files.
On FreeBSD a regular file is always reported as ready for writing, resulting in a busy wait.
On Darwin, Dragonfly, NetBSD and OpenBSD, a regular file is reported as ready for both reading and writing only once.

Updates #19093

Change-Id: If284341f60c6c2332fb5499637d4cfa7a4e26b7b
Reviewed-on: https://go-review.googlesource.com/c/156379
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agobufio: document relationship between UnreadByte/UnreadRune and Peek
Brad Fitzpatrick [Wed, 2 Jan 2019 18:33:31 +0000 (18:33 +0000)]
bufio: document relationship between UnreadByte/UnreadRune and Peek

Fixes #29387

Change-Id: I2d9981f63ac16630ed39d6da6692c81396f4e9ea
Reviewed-on: https://go-review.googlesource.com/c/155930
Reviewed-by: Ian Lance Taylor <iant@golang.org>