]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
6 years ago[release-branch.go1.9] all: merge master into release-branch.go1.9
Chris Broadfoot [Mon, 7 Aug 2017 17:28:03 +0000 (10:28 -0700)]
[release-branch.go1.9] all: merge master into release-branch.go1.9

579120323f runtime: mapassign_* should use typedmemmove to update keys
380525598c all: remove some manual hyphenation
f096b5b340 runtime: mark activeModules nosplit/nowritebarrier
3e3da54633 math/bits: fix example for OnesCount64
9b1e7cf2ac math/bits: add examples for OnesCount functions
b01db023b1 misc/cgo/testsanitizers: also skip tsan11/tsan12 when using GCC
a279b53a18 reflect: document how DeepEqual handles cycles
909f409a8d doc: mention handling of moved GOROOT in 1.9 release notes
58ad0176ca doc: use better wording to explain type-aware completion
92dac21d29 doc: replace paid with commercial
9bb98e02de doc/1.9: add CL 43712, ReverseProxy of HTTP/2 trailers to the release notes.
78d74fc2cd doc: clarify that Gogland is for paid IntelliJ platform IDEs
5495047223 doc/1.9: fix broken html link in CL 53030/53210
890e0e862f doc: fix bad link in go1.9 release notes
be596f049a doc/1.9: fix stray html in CL 53030
0173631d53 encoding/binary: add examples for varint functions
ac0ccf3cd2 doc/1.9: add CL 36696 for crypto/x509 to the release notes
cc402c2c4d doc: hide blog content for golang.google.cn
f396fa4285 internal/poll: don't add non-sockets to runtime poller
664cd26c89 cmd/vet: don't exit with failure on type checking error
a8730cd93a doc: hide video and share if being served from CN
b63db76c4a testsanitizers: check that tsan program runs, skip tsan10 on gcc
193eda7291 time: skip ZoneAbbr test in timezones with no abbreviation
6f08c935a9 cmd/go: show examples with empty output in go test -list
f20944de78 cmd/compile: set/unset base register for better assembly print
623e2c4603 runtime: map bitmap and spans during heap initialization
780249eed4 runtime: fall back to small mmaps if we fail to grow reservation
31b2c4cc25 .github: add .md extension to SUPPORT file
ac29f30dbb plugin: mention that there are known bugs with plugins
45a4609c0a cmd/dist: skip moved GOROOT on Go's Windows builders when not sharding tests
e157fac02d test: add README
835dfef939 runtime/pprof: prevent a deadlock that SIGPROF might create on mips{,le}
df91b8044d doc: list editor options by name, not plugin name
3d9475c04b doc: cleanup editor page
b9661a14ea doc: add Atom to editor guide
ee392ac10c cmd/compile: consider exported flag in namedata

Change-Id: I3a48493e8c05d97cb3b61635503ef0ccd646e5cb

6 years agoruntime: mapassign_* should use typedmemmove to update keys
Keith Randall [Sat, 5 Aug 2017 16:58:41 +0000 (09:58 -0700)]
runtime: mapassign_* should use typedmemmove to update keys

We need to make sure that when the key contains a pointer, we use
a write barrier to update the key.

Also mapdelete_* should use typedmemclr.

Fixes #21297

Change-Id: I63dc90bec1cb909c2c6e08676c9ec853d736cdf8
Reviewed-on: https://go-review.googlesource.com/53414
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoall: remove some manual hyphenation
Josh Bleecher Snyder [Sun, 6 Aug 2017 13:17:42 +0000 (06:17 -0700)]
all: remove some manual hyphenation

Manual hyphenation doesn't work well when text gets reflown,
for example by godoc.

There are a few other manual hyphenations in the tree,
but they are in local comments or comments for unexported functions.

Change-Id: I17c9b1fee1def650da48903b3aae2fa1e1119a65
Reviewed-on: https://go-review.googlesource.com/53510
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: mark activeModules nosplit/nowritebarrier
Ian Lance Taylor [Fri, 4 Aug 2017 17:36:40 +0000 (10:36 -0700)]
runtime: mark activeModules nosplit/nowritebarrier

The activeModules function is called by the cgo pointer checking code,
which is called by the write barrier (when GODEBUG=cgocheck=2), and as
such must be nosplit/nowritebarrier.

Fixes #21306

Change-Id: I57f2124f14de7f3872b2de9532abab15df95d45a
Reviewed-on: https://go-review.googlesource.com/53352
Reviewed-by: Austin Clements <austin@google.com>
6 years agomath/bits: fix example for OnesCount64
Francesc Campoy Flores [Sat, 5 Aug 2017 00:03:33 +0000 (17:03 -0700)]
math/bits: fix example for OnesCount64

Erroneously called OnesCount instead of OnesCount64

Change-Id: Ie877e43f213253e45d31f64931c4a15915849586
Reviewed-on: https://go-review.googlesource.com/53410
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years agomath/bits: add examples for OnesCount functions
Francesc Campoy [Fri, 4 Aug 2017 22:41:57 +0000 (15:41 -0700)]
math/bits: add examples for OnesCount functions

Change-Id: Ie673f9665825a40281c2584d478ba1260f725856
Reviewed-on: https://go-review.googlesource.com/53357
Run-TryBot: Chris Broadfoot <cbro@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years agomisc/cgo/testsanitizers: also skip tsan11/tsan12 when using GCC
Ian Lance Taylor [Fri, 4 Aug 2017 22:33:48 +0000 (15:33 -0700)]
misc/cgo/testsanitizers: also skip tsan11/tsan12 when using GCC

Updates #21196

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

6 years agoreflect: document how DeepEqual handles cycles
Ian Lance Taylor [Thu, 3 Aug 2017 00:52:06 +0000 (17:52 -0700)]
reflect: document how DeepEqual handles cycles

Fixes #20428

Change-Id: Ia450e615728efd4ccb6e42117b547cac162f13a3
Reviewed-on: https://go-review.googlesource.com/52931
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
6 years agodoc: mention handling of moved GOROOT in 1.9 release notes
Ian Lance Taylor [Fri, 4 Aug 2017 18:23:25 +0000 (11:23 -0700)]
doc: mention handling of moved GOROOT in 1.9 release notes

Updates #20587

Change-Id: Ia131b9a4dc4986950d9ecbfcbd6b026ade234fc0
Reviewed-on: https://go-review.googlesource.com/53370
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc: use better wording to explain type-aware completion
Jaana Burcu Dogan [Fri, 4 Aug 2017 19:59:55 +0000 (12:59 -0700)]
doc: use better wording to explain type-aware completion

Some editors can filter the autocompletion suggestions based on
whether the code will compile once autocompleted. Explain this
feature with better wording.

Change-Id: I29e4b0396878f18c79208915402c0a209a813b04
Reviewed-on: https://go-review.googlesource.com/53355
Reviewed-by: Florin Patan <florinpatan@gmail.com>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years agodoc: replace paid with commercial
Jaana Burcu Dogan [Fri, 4 Aug 2017 19:44:18 +0000 (12:44 -0700)]
doc: replace paid with commercial

Change-Id: I3e6de4da0648f61e254c7597f316df3e5791321a
Reviewed-on: https://go-review.googlesource.com/53354
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years agodoc/1.9: add CL 43712, ReverseProxy of HTTP/2 trailers to the release notes.
Tristan Colgate [Fri, 4 Aug 2017 07:27:56 +0000 (08:27 +0100)]
doc/1.9: add CL 43712, ReverseProxy of HTTP/2 trailers to the release notes.

Add https://go-review.googlesource.com/c/43712,
"net/http/httputil: ReverseProxy should pass on unannounced Trailers"
to the relase notes.

Fixes #21307

Change-Id: I52c126987a5d0abc4153c0e71b535529c46cd457
Reviewed-on: https://go-review.googlesource.com/53290
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc: clarify that Gogland is for paid IntelliJ platform IDEs
Jaana Burcu Dogan [Fri, 4 Aug 2017 16:47:06 +0000 (09:47 -0700)]
doc: clarify that Gogland is for paid IntelliJ platform IDEs

Fixes #21213.

Change-Id: I7b8a84de92bbd1d3f78f8a9612f3af8cd092cb94
Reviewed-on: https://go-review.googlesource.com/53351
Reviewed-by: Andrew Bonventre <andybons@golang.org>
6 years agodoc/1.9: fix broken html link in CL 53030/53210
Dmitry Savintsev [Fri, 4 Aug 2017 08:12:21 +0000 (10:12 +0200)]
doc/1.9: fix broken html link in CL 53030/53210

Change-Id: I7176becd10ad84cbfc3fb9427e190028626e5baf
Reviewed-on: https://go-review.googlesource.com/53291
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc: fix bad link in go1.9 release notes
Alberto Donizetti [Fri, 4 Aug 2017 10:13:33 +0000 (12:13 +0200)]
doc: fix bad link in go1.9 release notes

Change-Id: I64ba37428f5cc560f0f20fe039feaecf5fcda93e
Reviewed-on: https://go-review.googlesource.com/53330
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc/1.9: fix stray html in CL 53030
Dmitry Savintsev [Thu, 3 Aug 2017 21:25:59 +0000 (23:25 +0200)]
doc/1.9: fix stray html in CL 53030

Change-Id: Ib4102b1e2a8863712f725c4d1e37fdbe3dfe3c07
Reviewed-on: https://go-review.googlesource.com/53210
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoencoding/binary: add examples for varint functions
Axel Wagner [Sat, 15 Jul 2017 17:43:22 +0000 (11:43 -0600)]
encoding/binary: add examples for varint functions

Change-Id: I191f6e46b452fadde9f641140445d843b0c7d534
Reviewed-on: https://go-review.googlesource.com/48604
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc/1.9: add CL 36696 for crypto/x509 to the release notes
Dmitry Savintsev [Thu, 3 Aug 2017 14:51:32 +0000 (16:51 +0200)]
doc/1.9: add CL 36696 for crypto/x509 to the release notes

add https://go-review.googlesource.com/c/36696
"crypto/x509: ignore CN if SAN extension present"
to the release notes.

Fixes #21289

Change-Id: Ifa184d3816806a8da3c67b68476c923329acf13e
Reviewed-on: https://go-review.googlesource.com/53030
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agodoc: hide blog content for golang.google.cn
Andrew Bonventre [Thu, 3 Aug 2017 16:33:26 +0000 (12:33 -0400)]
doc: hide blog content for golang.google.cn

/blog redirects to blog.golang.org (currently blocked in China)
unless there is a local checkout of golang.org/x/blog, which is
not possible on App Engine Classic.

Change-Id: Ia695e663c9bebcc6c3bedea324c630299eaad4dc
Reviewed-on: https://go-review.googlesource.com/53051
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years agointernal/poll: don't add non-sockets to runtime poller
Ian Lance Taylor [Tue, 1 Aug 2017 23:05:17 +0000 (16:05 -0700)]
internal/poll: don't add non-sockets to runtime poller

Updates #21172

Change-Id: I0fec6e645328bbc85f3e47f4f71dd8d1d68c75ab
Reviewed-on: https://go-review.googlesource.com/52551
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
6 years agocmd/vet: don't exit with failure on type checking error
Ian Lance Taylor [Wed, 2 Aug 2017 19:06:58 +0000 (12:06 -0700)]
cmd/vet: don't exit with failure on type checking error

The vet tool only reports a type checking error when invoked with -v.
Don't let that by itself cause vet to exit with an error exit status.

Updates #21188

Change-Id: I172c13d46c35d49e229e96e833683d8c82a77de7
Reviewed-on: https://go-review.googlesource.com/52851
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
6 years agodoc: hide video and share if being served from CN
Andrew Bonventre [Wed, 2 Aug 2017 20:31:46 +0000 (16:31 -0400)]
doc: hide video and share if being served from CN

In the case where requests are coming from mainland China, hide
links to locations that are blocked and functionality that is
not permitted.

Additionally, some very small cleanup of the JS.

This change requires https://go-review.googlesource.com/c/52873

Change-Id: I7fc68748e629dbe5b966d6bf117e7f7b546966eb
Reviewed-on: https://go-review.googlesource.com/52872
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years agotestsanitizers: check that tsan program runs, skip tsan10 on gcc
Ian Lance Taylor [Wed, 2 Aug 2017 17:49:20 +0000 (10:49 -0700)]
testsanitizers: check that tsan program runs, skip tsan10 on gcc

Check not only that a tsan program can be built, but also that it runs.
This fails with some installations of GCC 7.

Skip the tsan10 program when using GCC, as it reportedly hangs.

This is a patch to help people build 1.9; we may be able to do a
better fix for 1.10.

Updates #21196

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

6 years agotime: skip ZoneAbbr test in timezones with no abbreviation
Alberto Donizetti [Tue, 1 Aug 2017 15:41:51 +0000 (17:41 +0200)]
time: skip ZoneAbbr test in timezones with no abbreviation

The testZoneAbbr assumes that

  Parse(RFC1123, t1.Format(RFC1123))

will always succeed. This is not true because Format will fall back to
the numeric zone (ex. -07) for timezones with no abbreviation, but
Parse won't accept the numeric zone when the layout specifies 'MST'
(an abbreviation).

Skip the zone abbreviation test in timezones with no abbreviation.

Fixes #21183

Change-Id: If04691cc23ae1075d8a953733024e17f5a7646de
Reviewed-on: https://go-review.googlesource.com/52430
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/go: show examples with empty output in go test -list
Seiji Takahashi [Sun, 30 Jul 2017 12:00:09 +0000 (21:00 +0900)]
cmd/go: show examples with empty output in go test -list

Fixes #21205

Change-Id: I81b001eb42cbf2a5d5b7b82eb63548b22f501be5
Reviewed-on: https://go-review.googlesource.com/52110
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

6 years agocmd/compile: set/unset base register for better assembly print
Cherry Zhang [Tue, 18 Jul 2017 12:35:00 +0000 (08:35 -0400)]
cmd/compile: set/unset base register for better assembly print

For address of an auto or arg, on all non-x86 architectures
the assembler backend encodes the actual SP offset in the
instruction but leaves the offset in Prog unchanged. When the
assembly is printed in compile -S, it shows an offset
relative to pseudo FP/SP with an actual hardware SP base
register (e.g. R13 on ARM). This is confusing. Unset the
base register if it is indeed SP, so the assembly output is
consistent. If the base register isn't SP, it should be an
error and the error output contains the actual base register.

For address loading instructions, the base register isn't set
in the compiler on non-x86 architectures. Set it. Normally it
is SP and will be unset in the change mentioned above for
printing. If it is not, it will be an error and the error
output contains the actual base register.

No change in generated binary, only printed assembly. Passes
"go build -a -toolexec 'toolstash -cmp' std cmd" on all
architectures.

Fixes #21064.

Change-Id: Ifafe8d5f9b437efbe824b63b3cbc2f5f6cdc1fd5
Reviewed-on: https://go-review.googlesource.com/49432
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
6 years ago[release-branch.go1.9] runtime: map bitmap and spans during heap initialization
Austin Clements [Fri, 28 Jul 2017 21:44:09 +0000 (17:44 -0400)]
[release-branch.go1.9] runtime: map bitmap and spans during heap initialization

We lazily map the bitmap and spans areas as the heap grows. However,
right now we're very slightly too lazy. Specifically, the following
can happen on 32-bit:

1. mallocinit fails to allocate any heap arena, so
   arena_used == arena_alloc == arena_end == bitmap.

2. There's less than 256MB between the end of the bitmap mapping and
   the next mapping.

3. On the first allocation, mheap.sysAlloc sees that there's not
   enough room in [arena_alloc, arena_end) because there's no room at
   all. It gets a 256MB mapping from somewhere *lower* in the address
   space than arena_used and sets arena_alloc and arena_end to this
   hole.

4. Since the new arena_alloc is lower than arena_used, mheap.sysAlloc
   doesn't bother to call mheap.setArenaUsed, so we still don't have a
   bitmap mapping or a spans array mapping.

5. mheap.grow, which called mheap.sysAlloc, attempts to fill in the
   spans array and crashes.

Fix this by mapping the metadata regions for the initial arena_used
when the heap is initialized, rather than trying to wait for an
allocation. This maintains the intended invariant that the structures
are always mapped for [arena_start, arena_used).

Fixes #21044.

Cherry-pick of CL 51714. Fixes #21234.

Change-Id: I4422375a6e234b9f979d22135fc63ae3395946b0
Reviewed-on: https://go-review.googlesource.com/52191
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years ago[release-branch.go1.9] runtime: fall back to small mmaps if we fail to grow reservation
Austin Clements [Fri, 28 Jul 2017 22:06:03 +0000 (18:06 -0400)]
[release-branch.go1.9] runtime: fall back to small mmaps if we fail to grow reservation

Right now, if it's possible to grow the arena reservation but
mheap.sysAlloc fails to get 256MB more of memory, it simply fails.
However, on 32-bit we have a fallback path that uses much smaller
mmaps that could take in this situation, but fail to.

This commit fixes mheap.sysAlloc to use a common failure path in case
it can't grow the reservation. On 32-bit, this path includes the
fallback.

Ideally, mheap.sysAlloc would attempt smaller reservation growths
first, but taking the fallback path is a simple change for Go 1.9.

Updates #21044 (fixes one of two issues).

Cherry-pick of CL 51713. Updates #21234.

Change-Id: I1e0035ffba986c3551479d5742809e43da5e7c73
Reviewed-on: https://go-review.googlesource.com/52190
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: map bitmap and spans during heap initialization
Austin Clements [Fri, 28 Jul 2017 21:44:09 +0000 (17:44 -0400)]
runtime: map bitmap and spans during heap initialization

We lazily map the bitmap and spans areas as the heap grows. However,
right now we're very slightly too lazy. Specifically, the following
can happen on 32-bit:

1. mallocinit fails to allocate any heap arena, so
   arena_used == arena_alloc == arena_end == bitmap.

2. There's less than 256MB between the end of the bitmap mapping and
   the next mapping.

3. On the first allocation, mheap.sysAlloc sees that there's not
   enough room in [arena_alloc, arena_end) because there's no room at
   all. It gets a 256MB mapping from somewhere *lower* in the address
   space than arena_used and sets arena_alloc and arena_end to this
   hole.

4. Since the new arena_alloc is lower than arena_used, mheap.sysAlloc
   doesn't bother to call mheap.setArenaUsed, so we still don't have a
   bitmap mapping or a spans array mapping.

5. mheap.grow, which called mheap.sysAlloc, attempts to fill in the
   spans array and crashes.

Fix this by mapping the metadata regions for the initial arena_used
when the heap is initialized, rather than trying to wait for an
allocation. This maintains the intended invariant that the structures
are always mapped for [arena_start, arena_used).

Fixes #21044.

Change-Id: I4422375a6e234b9f979d22135fc63ae3395946b0
Reviewed-on: https://go-review.googlesource.com/51714
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: fall back to small mmaps if we fail to grow reservation
Austin Clements [Fri, 28 Jul 2017 22:06:03 +0000 (18:06 -0400)]
runtime: fall back to small mmaps if we fail to grow reservation

Right now, if it's possible to grow the arena reservation but
mheap.sysAlloc fails to get 256MB more of memory, it simply fails.
However, on 32-bit we have a fallback path that uses much smaller
mmaps that could take in this situation, but fail to.

This commit fixes mheap.sysAlloc to use a common failure path in case
it can't grow the reservation. On 32-bit, this path includes the
fallback.

Ideally, mheap.sysAlloc would attempt smaller reservation growths
first, but taking the fallback path is a simple change for Go 1.9.

Updates #21044 (fixes one of two issues).

Change-Id: I1e0035ffba986c3551479d5742809e43da5e7c73
Reviewed-on: https://go-review.googlesource.com/51713
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years ago.github: add .md extension to SUPPORT file
Gustav Westling [Sun, 30 Jul 2017 20:14:22 +0000 (22:14 +0200)]
.github: add .md extension to SUPPORT file

This makes GitHub render the markdown file automatically
on their web UI.

SUPPORT.md is the recommended file name according to the GitHub
documentation:
https://help.github.com/articles/adding-support-resources-to-your-project/

Fixes #21223

Change-Id: I9f9b9daced9c29a16850e8c446656f353f50b1ae
Reviewed-on: https://go-review.googlesource.com/52013
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoplugin: mention that there are known bugs with plugins
Ian Lance Taylor [Wed, 26 Jul 2017 16:46:58 +0000 (09:46 -0700)]
plugin: mention that there are known bugs with plugins

Change-Id: I9e63661cac2bebc41d7aa3cd80e1920eec22b894
Reviewed-on: https://go-review.googlesource.com/51250
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
6 years ago[release-branch.go1.9] cmd/dist: skip moved GOROOT on Go's Windows builders when...
Brad Fitzpatrick [Thu, 27 Jul 2017 04:33:18 +0000 (04:33 +0000)]
[release-branch.go1.9] cmd/dist: skip moved GOROOT on Go's Windows builders when not sharding tests

Change-Id: I0bcae339624e7d61037d9ea0885b7bd07491bbb6
Reviewed-on: https://go-review.googlesource.com/51430
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit 4833e920c1d7f6b23458e6ff3c73951fcf754219)
Reviewed-on: https://go-review.googlesource.com/51450
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/dist: skip moved GOROOT on Go's Windows builders when not sharding tests
Brad Fitzpatrick [Thu, 27 Jul 2017 04:33:18 +0000 (04:33 +0000)]
cmd/dist: skip moved GOROOT on Go's Windows builders when not sharding tests

Change-Id: I0bcae339624e7d61037d9ea0885b7bd07491bbb6
Reviewed-on: https://go-review.googlesource.com/51430
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agotest: add README
Josh Bleecher Snyder [Mon, 24 Jul 2017 17:17:15 +0000 (10:17 -0700)]
test: add README

Updates #21034

Change-Id: I951fb48ab3b9ed54d225c11879db8f09048a36a3
Reviewed-on: https://go-review.googlesource.com/50950
Reviewed-by: Rob Pike <r@golang.org>
6 years agoruntime/pprof: prevent a deadlock that SIGPROF might create on mips{,le}
Vladimir Stefanovic [Thu, 4 May 2017 14:45:29 +0000 (16:45 +0200)]
runtime/pprof: prevent a deadlock that SIGPROF might create on mips{,le}

64bit atomics on mips/mipsle are implemented using spinlocks. If SIGPROF
is received while the program is in the critical section, it will try to
write the sample using the same spinlock, creating a deadloop.
Prevent it by creating a counter of SIGPROFs during atomic64 and
postpone writing the sample(s) until called from elsewhere, with
pc set to _LostSIGPROFDuringAtomic64.

Added a test case, per Cherry's suggestion. Works around #20146.

Change-Id: Icff504180bae4ee83d78b19c0d9d6a80097087f9
Reviewed-on: https://go-review.googlesource.com/42652
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
6 years agodoc: list editor options by name, not plugin name
Jaana Burcu Dogan [Tue, 25 Jul 2017 20:03:48 +0000 (13:03 -0700)]
doc: list editor options by name, not plugin name

So the users can recognize their option by their editor's name.

Fixes #20398.

Change-Id: Id314d4dbe26f40231a479b179620d7e66512b506
Reviewed-on: https://go-review.googlesource.com/51114
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years agodoc: cleanup editor page
Zac Bergquist [Tue, 25 Jul 2017 18:08:47 +0000 (14:08 -0400)]
doc: cleanup editor page

Fix some UI issues introduced with CL50952:
- increase header colspan to account for additional column
- remove ':' character from footnotes

Change-Id: I56f59b8e4b2852612b3c6c7c0dfe99125dd8b57b
Reviewed-on: https://go-review.googlesource.com/51113
Reviewed-by: Jaana Burcu Dogan <jbd@google.com>
6 years agodoc: add Atom to editor guide
Zac Bergquist [Mon, 24 Jul 2017 23:05:43 +0000 (19:05 -0400)]
doc: add Atom to editor guide

Fixes #20569

Change-Id: I752a49ed50c1567f8db7112859ac073f37dd77dc
Reviewed-on: https://go-review.googlesource.com/50952
Reviewed-by: Jaana Burcu Dogan <jbd@google.com>
6 years ago[release-branch.go1.9] go1.9rc1 go1.9rc1
Chris Broadfoot [Mon, 24 Jul 2017 17:28:28 +0000 (10:28 -0700)]
[release-branch.go1.9] go1.9rc1

Change-Id: I6251fc128990f9494a0b037cabb24ada5eabb6b5
Reviewed-on: https://go-review.googlesource.com/50951
Run-TryBot: Chris Broadfoot <cbro@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years ago[release-branch.go1.9] cmd/compile: consider exported flag in namedata
Ian Lance Taylor [Fri, 21 Jul 2017 23:37:40 +0000 (16:37 -0700)]
[release-branch.go1.9] cmd/compile: consider exported flag in namedata

It is possible to have an unexported name with a nil package,
for an embedded field whose type is a pointer to an unexported type.
We must encode that fact in the type..namedata symbol name,
to avoid incorrectly merging an unexported name with an exported name.

Fixes #21120

Change-Id: I2e3879d77fa15c05ad92e0bf8e55f74082db5111
Reviewed-on: https://go-review.googlesource.com/50710
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-on: https://go-review.googlesource.com/50970
Reviewed-by: Chris Broadfoot <cbro@golang.org>
6 years agocmd/compile: consider exported flag in namedata
Ian Lance Taylor [Fri, 21 Jul 2017 23:37:40 +0000 (16:37 -0700)]
cmd/compile: consider exported flag in namedata

It is possible to have an unexported name with a nil package,
for an embedded field whose type is a pointer to an unexported type.
We must encode that fact in the type..namedata symbol name,
to avoid incorrectly merging an unexported name with an exported name.

Fixes #21120

Change-Id: I2e3879d77fa15c05ad92e0bf8e55f74082db5111
Reviewed-on: https://go-review.googlesource.com/50710
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
6 years agocmd/link: use full link, not compile, to test for -no-?pie
Ian Lance Taylor [Mon, 24 Jul 2017 17:13:25 +0000 (10:13 -0700)]
cmd/link: use full link, not compile, to test for -no-?pie

This avoids an error from clang when using -nopie during compilation,
and permits us to check that the entire build succeeds.

Updates #21042

Change-Id: I2e6c7d5c97a85c223ed3288622bbb58ce33b8774
Reviewed-on: https://go-review.googlesource.com/50874
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years ago.github: recommend 'go bug' when filing an issue
Josh Bleecher Snyder [Mon, 24 Jul 2017 16:54:13 +0000 (09:54 -0700)]
.github: recommend 'go bug' when filing an issue

It was released with 1.8, so it should be widely available.

Change-Id: I7dcf205009b528071ea63f99cb5da0db183df341
Reviewed-on: https://go-review.googlesource.com/50932
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years ago.github: add SUPPORT file
Josh Bleecher Snyder [Mon, 24 Jul 2017 15:18:06 +0000 (08:18 -0700)]
.github: add SUPPORT file

GitHub recently added support for a SUPPORT file:

https://github.com/blog/2400-support-file-support

This SUPPORT file is a very lightly edited copy
of the wiki entry on asking questions:

https://github.com/golang/go/wiki/Questions

Change-Id: Ic1eb74d985ea30862defb99750fb42da84e492de
Reviewed-on: https://go-review.googlesource.com/50930
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoencoding/json: ignore embedded fields of pointers to unexported non-structs
Joe Tsai [Fri, 21 Jul 2017 23:53:54 +0000 (16:53 -0700)]
encoding/json: ignore embedded fields of pointers to unexported non-structs

https://golang.org/cl/33773 fixes the JSON marshaler to avoid serializing
embedded fields on unexported types of non-struct types. However, Go allows
embedding pointer to types, so the check for whether the field is a non-struct
type must first dereference the pointer to get at the underlying type.

Furthermore, due to a edge-case in the behavior of StructField.PkgPath not
being a reliable indicator of whether the field is unexported (see #21122),
we use our own logic to determine whether the field is exported or not.

The logic in this CL may be simplified depending on what happens in #21122.

Fixes #21121
Updates #21122

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

6 years agosync: delete a sentence from the Map docs
Brad Fitzpatrick [Fri, 21 Jul 2017 17:32:32 +0000 (17:32 +0000)]
sync: delete a sentence from the Map docs

From Josh's comments on https://golang.org/cl/50310

Once I removed the "from the Go standard library" bit, the beginning
wasn't worth keeping. It also wasn't clear whether what it meant by
"cache contention". Processor caches, or user-level caches built with
sync.Map? It didn't seem worth clarifying and didn't convey any useful
information, so deleted.

Change-Id: Id1d76105a3081d0855f6a64540700932bb83d98e
Reviewed-on: https://go-review.googlesource.com/50632
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
6 years agonet/http: document that after Hijack, Request.Body is invalid
Brad Fitzpatrick [Fri, 21 Jul 2017 18:52:38 +0000 (18:52 +0000)]
net/http: document that after Hijack, Request.Body is invalid

We can make it panic with a more explicit and readable error message
during Go 1.10, but document it for now. This has always been the
case; it's not a new rule.

Updates #20933

Change-Id: I53c1fefb47a8f4aae0bb32fa742afa3a2ed20e8a
Reviewed-on: https://go-review.googlesource.com/50634
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
6 years agosync: update Map documentation with usage rule of thumb
Michael Stapelberg [Thu, 20 Jul 2017 15:16:36 +0000 (08:16 -0700)]
sync: update Map documentation with usage rule of thumb

As per bcmills’s lightning talk at GopherCon 2017:
https://github.com/gophercon/2017-talks/tree/master/lightningtalks/BryanCMills-AnOverviewOfSyncMap

Change-Id: I12dd0daa608af175d110298780f32c6dc5e1e0a0
Reviewed-on: https://go-review.googlesource.com/50310
Reviewed-by: Bryan Mills <bcmills@google.com>
6 years agodoc: minor fixes to the editor guide
Jaana Burcu Dogan [Fri, 21 Jul 2017 01:16:03 +0000 (18:16 -0700)]
doc: minor fixes to the editor guide

Change-Id: I8f6bcfab27251ef6962306d56e40d306ef85fe60
Reviewed-on: https://go-review.googlesource.com/50472
Reviewed-by: Rob Pike <r@golang.org>
6 years agoruntime: improve out-of-memory message when VirtualAlloc fails
Austin Clements [Tue, 18 Jul 2017 15:14:28 +0000 (11:14 -0400)]
runtime: improve out-of-memory message when VirtualAlloc fails

Fixes #19514.

Change-Id: I93600d5c3d11ecab5a47dd4cd55ed3aea05e221e
Reviewed-on: https://go-review.googlesource.com/49611
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agonet/http: improve signature of Redirect, NewRequest
Dmitri Shuralyov [Wed, 19 Jul 2017 04:41:13 +0000 (00:41 -0400)]
net/http: improve signature of Redirect, NewRequest

In CL https://golang.org/cl/4893043 (6 years ago), a new package named
"url" was created (it is currently known as "net/url"). During that
change, some identifier name collisions were introduced, and two
parameters in net/http were renamed to "urlStr".

Since that time, Go has continued to put high emphasis on the quality
and readability of the documentation. Sometimes, that means making small
sacrifices in the implementation details of a package to ensure that
the godoc reads better, since that's what the majority of users interact
with. See https://golang.org/s/style#named-result-parameters:

> Clarity of docs is always more important than saving a line or two
> in your function.

I think the "urlStr" parameter name is suboptimal for godoc purposes,
and just "url" would be better.

During the review of https://golang.org/cl/4893043, it was also noted
by @rsc that having to rename parameters named "url" was suboptimal:

> It's unfortunate that naming the package url means
> you can't have a parameter or variable named url.

However, at the time, the name of the url package was still being
decided, and uri was an alternative name under consideration.
The reason urlStr was chosen is because it was a lesser evil
compared to naming the url package uri instead:

> Let's not get hung up on URI vs. URL, but I'd like s/uri/urlStr/ even for just
> that the "i" in "uri" looks very similar to the "l" in "url" in many fonts.

> Please let's go with urlStr instead of uri.

Now that we have the Go 1 compatibility guarantee, the name of the
net/url package is fixed. However, it's possible to improve the
signature of Redirect, NewRequest functions in net/http package
for godoc purposes by creating a package global alias to url.Parse,
and renaming urlStr parameter to url in the exported funcs. This CL
does so.

Updates #21077.

Change-Id: Ibcc10e3825863a663e6ad91b6eb47b1862a299a6
Reviewed-on: https://go-review.googlesource.com/49930
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agocmd/go, cmd/link: if -no-pie doesn't work, try -nopie
Ian Lance Taylor [Tue, 18 Jul 2017 20:15:05 +0000 (13:15 -0700)]
cmd/go, cmd/link: if -no-pie doesn't work, try -nopie

GCC says -no-pie, clang says -nopie.

Fixes #21042

Change-Id: Iadc83ea7a48ea0debc5064c1ee8da4ebff752044
Reviewed-on: https://go-review.googlesource.com/49710
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agosync: release m.mu during (*RWMutexMap).Range callbacks in sync_test
Bryan C. Mills [Tue, 9 May 2017 20:12:57 +0000 (16:12 -0400)]
sync: release m.mu during (*RWMutexMap).Range callbacks in sync_test

The mainline sync.Map has allowed mutations within Range callbacks
since https://golang.org/cl/37342. The reference implementations need
to do the same.

This change integrates https://go-review.googlesource.com/c/42956/
from x/sync.

Change-Id: I6b58cf874bb31cd4f6fdb8bfa8278888ed617a5a
Reviewed-on: https://go-review.googlesource.com/42957
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agomisc/cgo/testsanitizers: add regression test for change 50251
Bryan C. Mills [Thu, 20 Jul 2017 17:47:57 +0000 (13:47 -0400)]
misc/cgo/testsanitizers: add regression test for change 50251

http://golang.org/cl/50251 fixed a regression under TSAN.
This change adds a minimal reproducer for the observed symptom.

Change-Id: Ib9ad01b458b7fdec14d6c2fe3c243f9c64b3dcf2
Reviewed-on: https://go-review.googlesource.com/50371
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agocmd/go: fix test when go source tree has POSIX ACL
Jess Frazelle [Thu, 20 Jul 2017 16:29:15 +0000 (12:29 -0400)]
cmd/go: fix test when go source tree has POSIX ACL

Fixes TestGoBuildUmask when the user has a POSIX ACL on the Go source tree.

Fixes #17909.

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

6 years agoruntime: use SIGKILL if SIGQUIT is blocked; skip tests that need SIGQUIT
Austin Clements [Thu, 20 Jul 2017 15:12:37 +0000 (11:12 -0400)]
runtime: use SIGKILL if SIGQUIT is blocked; skip tests that need SIGQUIT

The runtime tests may be invoked from a parent that has SIGQUIT
blocked. For example, Java invokes subprocesses this way. In this
situation, TestCrashDumpsAllThreads and TestPanicSystemstack will fail
because they depend on SIGQUIT to get tracebacks, and any subprocess
test that times out will fail to kill the subprocess.

Fix this by detecting if SIGQUIT is blocked and, if so, skipping tests
that depend on it and using SIGKILL to kill timed-out subprocesses.

Based on a fix by Carl Henrik Lunde in
https://golang.org/issue/19196#issuecomment-316145733

Fixes #19196.

Change-Id: Ia20bf15b96086487d0ef6b75239dcc260c21714c
Reviewed-on: https://go-review.googlesource.com/50330
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agoruntime: don't call libc sigaction function in forked child
Ian Lance Taylor [Thu, 20 Jul 2017 06:42:27 +0000 (23:42 -0700)]
runtime: don't call libc sigaction function in forked child

If we are using vfork, and if something (such as TSAN) is intercepting
the sigaction function, then we must call the system call, not the
libc function. Otherwise the intercepted sigaction call in the child
may trash the data structures in the parent.

Change-Id: Id9588bfeaa934f32c920bf829c5839be5cacf243
Reviewed-on: https://go-review.googlesource.com/50251
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-by: Austin Clements <austin@google.com>
6 years agoos: remove duplicate check from windows os.Stat
Johnny Luo [Thu, 20 Jul 2017 07:20:46 +0000 (17:20 +1000)]
os: remove duplicate check from windows os.Stat

Fixes #21075

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

6 years agonet/mail: Fix typo
yansal [Wed, 19 Jul 2017 21:04:36 +0000 (23:04 +0200)]
net/mail: Fix typo

Fixes #21089

Change-Id: Idd65c7185b3e19f33958eb165cb5b09c06db3d56
Reviewed-on: https://go-review.googlesource.com/50110
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc: add an editor guide
Jaana Burcu Dogan [Wed, 14 Jun 2017 19:41:14 +0000 (12:41 -0700)]
doc: add an editor guide

The Go ecosystem provides many tools to make Go
development more productive and seamless. Document
the availability of the editor plugins and IDEs,
add an overview of feature support and screencasts.

Updates #20398.
Updates #20402.
Updates #20399.
Updates #20401.
Updates #20569.

Change-Id: I0c6cb48eb4e3848807aaad78390493e14f097916
Reviewed-on: https://go-review.googlesource.com/45772
Reviewed-by: Steve Francia <spf@golang.org>
6 years agoruntime: only trace mark assists that do work
Austin Clements [Wed, 19 Jul 2017 18:18:08 +0000 (14:18 -0400)]
runtime: only trace mark assists that do work

Currently we trace mark assists even if they're satisfied entirely by
stealing. This means even if background marking is keeping up with
allocation, we'll still emit a trace event every N bytes of
allocation. The event will be a few microseconds, if that, but they're
frequent enough that, when zoomed out in the trace view, it looks like
all of the time is spent in mark assists even if almost none is.

Change this so we only emit a trace event if the assist actually has
to do assisting. This makes the traces of these events far more
useful.

Change-Id: If4aed1c413b814341ef2fba61d2f10751d00451b
Reviewed-on: https://go-review.googlesource.com/50030
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
6 years agocmd/compile: fix unaligned loads/stores to global variables on s390x
Michael Munday [Mon, 17 Jul 2017 11:07:28 +0000 (07:07 -0400)]
cmd/compile: fix unaligned loads/stores to global variables on s390x

Load/store-merging and move optimizations can result in unaligned
memory accesses. This is fine so long as the load/store instruction
used does not take a relative offset. In the SSA rules this means we
must not merge (MOVDaddr (SB)) ops into loads/stores unless we can
guarantee the alignment of the target.

Fixes #21048.

Change-Id: I70f13a62a148d5f0a56e704e8f76e36b4a4226d9
Reviewed-on: https://go-review.googlesource.com/49250
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
6 years agonet/http: fix parameter name in comment
Ian Lance Taylor [Tue, 18 Jul 2017 20:29:47 +0000 (13:29 -0700)]
net/http: fix parameter name in comment

Fixes #21077

Change-Id: Ic61d7313907f58ff4027fd2eee1ddb8c1656304d
Reviewed-on: https://go-review.googlesource.com/49712
Reviewed-by: Dmitri Shuralyov <shurcool@gmail.com>
6 years agoruntime: move tSweepTerm capture closer to STW
Austin Clements [Tue, 18 Jul 2017 15:21:15 +0000 (11:21 -0400)]
runtime: move tSweepTerm capture closer to STW

tSweepTerm and pauseStart are supposed to be when STW was triggered,
but right now they're captured a bit before STW. Move these down to
immediately before we trigger STW.

Fixes #19590.

Change-Id: Icd48a5c4d45c9b36187ff986e4f178b5064556c1
Reviewed-on: https://go-review.googlesource.com/49612
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoruntime: always use 2MB stacks on 64-bit Windows
Austin Clements [Mon, 17 Jul 2017 18:18:49 +0000 (14:18 -0400)]
runtime: always use 2MB stacks on 64-bit Windows

Currently, Windows stacks are either 128kB or 2MB depending on whether
the binary uses cgo. This is because we assume that Go system stacks
and the small amount of C code invoked by the standard library can
operate within smaller stacks, but general Windows C code assumes
larger stacks.

However, it's easy to call into arbitrary C code using the syscall
package on Windows without ever importing cgo into a binary. Such
binaries need larger system stacks even though they don't use cgo.

Fix this on 64-bit by increasing the system stack size to 2MB always.
This only costs address space, which is free enough on 64-bit to not
worry about. We keep (for now) the existing heuristic on 32-bit, where
address space comes at more of a premium.

Updates #20975.

Change-Id: Iaaaa9a2fcbadc825cddc797aaaea8d34ef8debf2
Reviewed-on: https://go-review.googlesource.com/49331
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
6 years agodatabase/sql: fix wrong method name in description
Alexey Palazhchenko [Tue, 18 Jul 2017 04:18:35 +0000 (07:18 +0300)]
database/sql: fix wrong method name in description

Change-Id: Ie6a88b70d7c45c59995ee2f57fb28f9a3cbb404d
Reviewed-on: https://go-review.googlesource.com/49470
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoA+C: final updates for Go 1.9
Brad Fitzpatrick [Mon, 17 Jul 2017 19:34:18 +0000 (19:34 +0000)]
A+C: final updates for Go 1.9

Add Adam Kisala (individual CLA)
Add Aditya Mukerjee (individual CLA)
Add Akhil Indurti (individual CLA)
Add André Carvalho (individual CLA)
Add Andy Walker (individual CLA)
Add Awn Umar (individual CLA)
Add Bastian Ike (individual CLA)
Add Brian Downs (individual CLA)
Add Cody Oss (individual CLA)
Add Costin Chirvasuta (corporate CLA for Google Inc.)
Add Dan Ballard (individual CLA)
Add Dong-hee Na (individual CLA)
Add Dylan Waits (individual CLA)
Add Evan Hicks (individual CLA)
Add Fannie Zhang (corporate CLA for ARM Ltd.)
Add Francisco Rojas (individual CLA)
Add Gabriel Nicolas Avellaneda (individual CLA)
Add Gabríel Arthúr Pétursson (individual CLA)
Add Greg Poirier (individual CLA)
Add Iccha Sethi (individual CLA)
Add Ivan Moscoso (individual CLA)
Add Jamie Kerr (individual CLA)
Add Joe Kyo (individual CLA)
Add Joey Geiger (individual CLA)
Add John R. Lenton (individual CLA)
Add Johnny Luo (individual CLA)
Add Josh Roppo (individual CLA)
Add Kate Manson (individual CLA)
Add Leo Rudberg (corporate CLA for Google Inc.)
Add Ma Peiqi (individual CLA)
Add Martynas Budriūnas (corporate CLA for Google Inc.)
Add Maryan Hratson (individual CLA)
Add Michael Edwards (individual CLA)
Add Michael Hendricks (individual CLA)
Add Pablo Santiago Blum de Aguiar (individual CLA)
Add Pat Moroney (individual CLA)
Add Shi Han Ng (individual CLA)
Add Steven Buss (corporate CLA for Google Inc.)
Add Suzy Mueller (corporate CLA for Google Inc.)
Add Taro Aoki (individual CLA)
Add Tim Heckman (individual CLA)
Add Tony Walker (individual CLA)
Add Yasha Bubnov (individual CLA)

Updates #12042

Change-Id: Iee063dd6c5a39de16907acfb5af87e81a05ab417
Reviewed-on: https://go-review.googlesource.com/49351
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agosyscall: update check for UserNS support for centos 7
Jess Frazelle [Mon, 17 Jul 2017 17:51:37 +0000 (13:51 -0400)]
syscall: update check for UserNS support for centos 7

Fixes #20796
Fixes #16283

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

6 years agocmd/compile: omit X:framepointer in compile version
Russ Cox [Mon, 17 Jul 2017 14:45:27 +0000 (10:45 -0400)]
cmd/compile: omit X:framepointer in compile version

Framepointer is the default now. Only print an X: list
if the settings are _not_ the default.

Before:

$ go tool compile -V
compile version devel +a5f30d9508 Sun Jul 16 14:43:48 2017 -0400 X:framepointer
$ go1.8 tool compile -V
compile version go1.8 X:framepointer
$

After:

$ go tool compile -V
compile version devel +a5f30d9508 Sun Jul 16 14:43:48 2017 -0400
$ go1.9 tool compile -V # imagined
compile version go1.9
$

Perpetuates #18317.

Change-Id: I981ba5c62be32e650a166fc9740703122595639b
Reviewed-on: https://go-review.googlesource.com/49252
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agostrconv: apply Brad's review comment
Russ Cox [Mon, 17 Jul 2017 15:12:20 +0000 (11:12 -0400)]
strconv: apply Brad's review comment

Missed in CL 49253 because I submitted from the Gerrit UI and
had not mailed the latest copy. Sigh.

Change-Id: I540f960278df43e2eaf1aac188eb124a1ff240dd
Reviewed-on: https://go-review.googlesource.com/49256
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
6 years agostrconv: fix initialization of atofRandomTests
Russ Cox [Mon, 17 Jul 2017 15:12:20 +0000 (11:12 -0400)]
strconv: fix initialization of atofRandomTests

The init func was using testing.Short, but that's not available
until after flag parsing. Found by CL 49251.

Change-Id: Ia7b871043375260873fa2c7e81e1d43c1c83d33f
Reviewed-on: https://go-review.googlesource.com/49253
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agotime: fix 400 years offset in comment
Alberto Donizetti [Mon, 17 Jul 2017 09:35:39 +0000 (11:35 +0200)]
time: fix 400 years offset in comment

Fixes #21043

Change-Id: I12db4f67ddee80500ff323f84e8fa34511650e63
Reviewed-on: https://go-review.googlesource.com/49230
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc/go1.9: eliminate <code> spaces
Russ Cox [Thu, 6 Jul 2017 18:46:45 +0000 (14:46 -0400)]
doc/go1.9: eliminate <code> spaces

Per note at top of doc, we don't use fixed-width spaces
in fixed-width phrases like "go doc".

Also ASN.1 NULL is not code so it's not <code> at all.

Change-Id: I791e4e6030b8b8d42f4621d2f4bf32fef93cf343
Reviewed-on: https://go-review.googlesource.com/47693
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agodoc/go1.9: minor clarifications and grammar nits
Russ Cox [Thu, 6 Jul 2017 18:45:05 +0000 (14:45 -0400)]
doc/go1.9: minor clarifications and grammar nits

Change-Id: I55f50e45f8872f063c3b6c9e89261d14689e77ce
Reviewed-on: https://go-review.googlesource.com/47692
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agolog: adds a Logger Output method Example
gmarik [Sat, 15 Jul 2017 18:11:42 +0000 (12:11 -0600)]
log: adds a Logger Output method Example

Change-Id: Ia3e351169a4ebe6db5e5f37b668f23dc8c992c78
Reviewed-on: https://go-review.googlesource.com/48877
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agobytes: add example for (*Buffer).Grow
Brian Downs [Sat, 15 Jul 2017 22:55:41 +0000 (16:55 -0600)]
bytes: add example for (*Buffer).Grow

Change-Id: I04849883dd2e1f6d083e9f57d2a8c1bd7d258953
Reviewed-on: https://go-review.googlesource.com/48878
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
6 years agoast: make ExampleCommentMap a runnable example
closs [Sat, 15 Jul 2017 22:07:30 +0000 (16:07 -0600)]
ast: make ExampleCommentMap a runnable example

Fixes #20450

Change-Id: I2256282a8880e99508e98fefedfb94a7cccacbcf
Reviewed-on: https://go-review.googlesource.com/48969
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
6 years agoio/ioutil: add example for ReadFile
Vitor De Mario [Sat, 15 Jul 2017 17:25:37 +0000 (11:25 -0600)]
io/ioutil: add example for ReadFile

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

6 years agosort: add example for Strings
Tony Walker [Sat, 15 Jul 2017 22:27:29 +0000 (22:27 +0000)]
sort: add example for Strings

Change-Id: I33f0e2362e85287b493d9279d43b760733e2abcb
Reviewed-on: https://go-review.googlesource.com/48831
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
6 years agomath/bits: add examples for leading zero methods
Dylan Waits [Sat, 15 Jul 2017 21:08:56 +0000 (15:08 -0600)]
math/bits: add examples for leading zero methods

Change-Id: Ib491d144387a7675af370f7b925fe6e62440d153
Reviewed-on: https://go-review.googlesource.com/48966
Run-TryBot: Kevin Burke <kev@inburke.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Kevin Burke <kev@inburke.com>
6 years agoos/exec: add example for Cmd.Run
André Carvalho [Sat, 15 Jul 2017 17:42:31 +0000 (14:42 -0300)]
os/exec: add example for Cmd.Run

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

6 years agoencoding/json: fix indentation in Decode stream example
Iccha Sethi [Sat, 15 Jul 2017 18:28:12 +0000 (13:28 -0500)]
encoding/json: fix indentation in Decode stream example

The existing example for Decoder.Decode (Stream) had excessive
indentation in the godoc interface for the const jsonStream,
making it hard to read. This fixes the indentation in the
example_test.go to improve the readability in godoc.

Helps #21026.

Change-Id: I16f56b82182da1dcc73cca44e535a7f5695e975d
Reviewed-on: https://go-review.googlesource.com/48910
Reviewed-by: Dmitri Shuralyov <shurcool@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoencoding/binary: add examples for ByteOrder functions
Ross Light [Sat, 15 Jul 2017 20:53:42 +0000 (14:53 -0600)]
encoding/binary: add examples for ByteOrder functions

Change-Id: Iec9a7bf61566ee08c4d15adb39d43c7a29c79122
Reviewed-on: https://go-review.googlesource.com/48962
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

6 years agostrings: add a example for TrimFunc
Francisco Rojas [Sat, 15 Jul 2017 20:51:58 +0000 (14:51 -0600)]
strings: add a example for TrimFunc

Change-Id: I9c0c601ec5957475e949dcc4a8c2116724d01215
Reviewed-on: https://go-review.googlesource.com/48961
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

6 years agoarchive/zip: remove an out of date TODO
Johnny Luo [Sat, 15 Jul 2017 17:58:00 +0000 (03:58 +1000)]
archive/zip: remove an out of date TODO

It had been implemented. Refer to https://golang.org/pkg/archive/zip/#FileHeader.Comment

Change-Id: I81572562c3111b58189baa3510b9ba688fe269c9
Reviewed-on: https://go-review.googlesource.com/48857
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agoregexp: example for MatchString function
Josh Roppo [Sat, 15 Jul 2017 20:40:22 +0000 (13:40 -0700)]
regexp: example for MatchString function

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

6 years agoruntime: fix duplicate "the"s
Daniel Morsing [Sat, 15 Jul 2017 20:53:44 +0000 (14:53 -0600)]
runtime: fix duplicate "the"s

kicking off contributing again with a classic

Change-Id: Ifb0aed8f1dc854f85751ce0495967a3c4315128d
Reviewed-on: https://go-review.googlesource.com/49016
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agotime: clarify documentation for Location.String
Pat Moroney [Sat, 15 Jul 2017 20:39:00 +0000 (14:39 -0600)]
time: clarify documentation for Location.String

Change-Id: I5c32a968303848304cbd6fe1e83bed0af11f6440
Reviewed-on: https://go-review.googlesource.com/48960
Reviewed-by: Caleb Spare <cespare@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agostrings: add a example for Compare func
Francisco Rojas [Sat, 15 Jul 2017 20:32:15 +0000 (14:32 -0600)]
strings: add a example for Compare func

Add a example for string.Compare that return the three possible results.

Change-Id: I103cf39327c1868fb249538d9e22b11865ba4b70
Reviewed-on: https://go-review.googlesource.com/49011
Reviewed-by: Heschi Kreinick <heschi@google.com>
6 years agoregexp: clarify example for 'FindString'
Ivan Moscoso [Sat, 15 Jul 2017 17:53:48 +0000 (11:53 -0600)]
regexp: clarify example for 'FindString'

Clarifying that FindString only provides left-most match

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

6 years agostrings: add example for IndexByte
Pablo Santiago Blum de Aguiar [Sat, 15 Jul 2017 18:13:45 +0000 (12:13 -0600)]
strings: add example for IndexByte

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

6 years agomath/rand: add concurrency warning to overview comment
Aditya Mukerjee [Sat, 15 Jul 2017 20:27:30 +0000 (16:27 -0400)]
math/rand: add concurrency warning to overview comment

Change-Id: I52efa7aa72a23256e5ca56470ffeba975ed8f739
Reviewed-on: https://go-review.googlesource.com/48760
Reviewed-by: Bryan Mills <bcmills@google.com>
6 years agostrings: add example for LastIndexAny
Evan Hicks [Sat, 15 Jul 2017 18:07:04 +0000 (12:07 -0600)]
strings: add example for LastIndexAny

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

6 years agomath: add a Sqrt example
Martynas Budriūnas [Sat, 15 Jul 2017 18:58:19 +0000 (12:58 -0600)]
math: add a Sqrt example

Change-Id: I259e25b9d0b069912053a250e9739e04fafca54d
Reviewed-on: https://go-review.googlesource.com/48892
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agostrconv: adds missing comment to neg flag, formats comment on trunc flag
Adam Kisala [Sat, 15 Jul 2017 18:27:56 +0000 (19:27 +0100)]
strconv: adds missing comment to neg flag, formats comment on trunc flag

Change-Id: Ibdd57489543d57a24d1e3c41210abd9fbc930b8f
Reviewed-on: https://go-review.googlesource.com/48867
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
6 years agoio: Add example to io.Seeker's Seek() method.
Greg Poirier [Sat, 15 Jul 2017 18:03:33 +0000 (12:03 -0600)]
io: Add example to io.Seeker's Seek() method.

While there's an example for SectionReader.Seek, if someone is
seeking documentation specifically about Seeker.Seek, they may
not immediately find the SectionReader example. Offset and whence
may not be entirely intuitive to new developers either, so include
examples of both positive/negative offsets and SeekStart/SeekEnd.

Change-Id: I5b7442ccf683d9706e9261c11bc0ea31a1ac21d4
Reviewed-on: https://go-review.googlesource.com/48873
Reviewed-by: Kevin Burke <kev@inburke.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

6 years agocmd/compile: fix comment typo
Jamie Kerr [Sat, 15 Jul 2017 18:20:25 +0000 (12:20 -0600)]
cmd/compile: fix comment typo

Change-Id: If581bd4e9d9b4421e2ae20582c596fccb73d9aed
Reviewed-on: https://go-review.googlesource.com/48866
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 years agostrings: add example for ContainsRune
Kate Manson [Sat, 15 Jul 2017 18:07:55 +0000 (12:07 -0600)]
strings: add example for ContainsRune

Change-Id: I994f003c97a14d194df5f07dd217c0ff3b214741
Reviewed-on: https://go-review.googlesource.com/48874
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Run-TryBot: Matt Layher <mdlayher@gmail.com>

6 years agoos: use Fstat instead of Stat in FileMode example
Taro Aoki [Sat, 1 Jul 2017 10:13:03 +0000 (19:13 +0900)]
os: use Fstat instead of Stat in FileMode example

The existing example for FileMode using Stat to get FileInfo.
But, Stat cannot get symlink info, it need to use Fstat instead.

Change-Id: I5cc38cd10caaa5912946abe2a2b90995a91ee10f
Reviewed-on: https://go-review.googlesource.com/47370
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>