]> Cypherpunks repositories - gostls13.git/log
gostls13.git
8 years agopath: document that filepath is recommended to manipulate filename paths
Jaana Burcu Dogan [Mon, 31 Oct 2016 17:23:50 +0000 (10:23 -0700)]
path: document that filepath is recommended to manipulate filename paths

Fixes #17690.

Change-Id: Ifd300980aa4c11498ed7c083d08bcdd23f5b307a
Reviewed-on: https://go-review.googlesource.com/32423
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc: add a CL to go1.8.txt mentioned by Alberto Donizetti
Brad Fitzpatrick [Tue, 8 Nov 2016 18:23:43 +0000 (18:23 +0000)]
doc: add a CL to go1.8.txt mentioned by Alberto Donizetti

Change-Id: I43617e6dfd5b8227a8ef907dc22c00188de87b94
Reviewed-on: https://go-review.googlesource.com/32915
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc: reference go1.4-bootstrap-20161024.tar.gz
Brad Fitzpatrick [Fri, 28 Oct 2016 18:03:21 +0000 (18:03 +0000)]
doc: reference go1.4-bootstrap-20161024.tar.gz

Updates #16352

Change-Id: I214c87579ef21ced8d0ba94aa170dd7780afec4b
Reviewed-on: https://go-review.googlesource.com/32312
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/asm: add support for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:50:38 +0000 (23:50 +0200)]
cmd/asm: add support for GOARCH=mips{,le}

Change-Id: I6a5256a42f895bb93ac56764e91ade1861c00e04
Reviewed-on: https://go-review.googlesource.com/31476
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
8 years agonet/http: deflake TestClientRedirects
Brad Fitzpatrick [Tue, 8 Nov 2016 17:44:53 +0000 (17:44 +0000)]
net/http: deflake TestClientRedirects

Fix another case of a parallel test relying on a global variable
(DefaultTransport) implicitly.

Use the private Transport already in scope instead. It's closed at the
end, instead of randomly via another test.

Change-Id: I95e51926177ad19a766cabbb306782ded1bbb59b
Reviewed-on: https://go-review.googlesource.com/32913
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocrypto/elliptic: add s390x assembly implementation of NIST P-256 Curve
Volodymyr Paprotski [Fri, 14 Oct 2016 20:19:25 +0000 (16:19 -0400)]
crypto/elliptic: add s390x assembly implementation of NIST P-256 Curve

A paranoid go at constant time implementation of P256 curve.

This code relies on z13 SIMD instruction set. For zEC12 and below,
the fallback is the existing P256 implementation. To facilitate this
fallback mode, I've refactored the code so that implementations can
be picked at run-time.

Its 'slightly' difficult to grok, but there is ASCII art..

name            old time/op  new time/op  delta
BaseMultP256     419µs ± 3%    27µs ± 1%  -93.65% (p=0.000 n=10+8)
ScalarMultP256  1.05ms ±10%  0.09ms ± 1%  -90.94% (p=0.000 n=10+8)

Change-Id: Ic1ded898a2ceab055b1c69570c03179c4b85b177
Reviewed-on: https://go-review.googlesource.com/31231
Run-TryBot: Michael Munday <munday@ca.ibm.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/internal/obj/mips: add support for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:50:37 +0000 (23:50 +0200)]
cmd/internal/obj/mips: add support for GOARCH=mips{,le}

Implements subset of MIPS32(r1) instruction set.

Change-Id: Iba017350f6c2763de05d4d1bc2f123e8eb76d0ff
Reviewed-on: https://go-review.googlesource.com/31475
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
8 years agosyscall: fix name of prlimit parameters
Brad Fitzpatrick [Tue, 8 Nov 2016 02:25:23 +0000 (02:25 +0000)]
syscall: fix name of prlimit parameters

Fixes #17606

Change-Id: I040c7621cef265d44b58f16556e6d58660a2245d
Reviewed-on: https://go-review.googlesource.com/32889
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoos: cleanup directories created by TestLongPath
Mohit Agarwal [Tue, 8 Nov 2016 12:16:10 +0000 (17:46 +0530)]
os: cleanup directories created by TestLongPath

Add tmpdir as a parameter to the closure otherwise the subsequent
modifications to tmpdir causes only the last subdirectory to be
removed.

Additionally, add the missing argument for the t.Fatalf call.

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

8 years agogo/types: document that selectors are not recorded in Info.Types
Robert Griesemer [Mon, 7 Nov 2016 23:56:41 +0000 (15:56 -0800)]
go/types: document that selectors are not recorded in Info.Types

Fixes #11944.

Change-Id: I424ba93725f22fd599e052eb182f9ba2fca8e8bd
Reviewed-on: https://go-review.googlesource.com/32881
Reviewed-by: Alan Donovan <adonovan@google.com>
8 years agodoc/devel/release.html: document go1.6.3 doesn't actually support macOS Sierra
Shenghou Ma [Tue, 8 Nov 2016 00:08:51 +0000 (19:08 -0500)]
doc/devel/release.html: document go1.6.3 doesn't actually support macOS Sierra

Updates #17824.

Change-Id: I73cf89c21b418158c7014c3271cd1103a17a5c86
Reviewed-on: https://go-review.googlesource.com/32882
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc/go1.8.txt: mention os.Executable addition
Shenghou Ma [Tue, 8 Nov 2016 00:16:17 +0000 (19:16 -0500)]
doc/go1.8.txt: mention os.Executable addition

Change-Id: Id3d571666b9275e3fa5cb20762afbd391dbcdeba
Reviewed-on: https://go-review.googlesource.com/32883
Reviewed-by: Minux Ma <minux@golang.org>
8 years agoos: add Executable() (string, error)
Shenghou Ma [Sun, 1 Nov 2015 09:18:58 +0000 (04:18 -0500)]
os: add Executable() (string, error)

// Executable returns the path name for the executable that started
// the current process. There is no guarantee that the path is still
// pointing to the correct executable. If a symlink was used to start
// the process, depending on the operating system, the result might
// be the symlink or the path it pointed to. If a stable result is
// needed, path/filepath.EvalSymlinks might help.
//
// Executable returns an absolute path unless an error occurred.
//
// The main use case is finding resources located relative to an
// executable.
//
// Executable is not supported on nacl or OpenBSD (unless procfs is
// mounted.)
func Executable() (string, error) {
return executable()
}

Fixes #12773.

Change-Id: I469738d905b12f0b633ea4d88954f8859227a88c
Reviewed-on: https://go-review.googlesource.com/16551
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agointernal/syscall/windows: add GetModuleFileName
Shenghou Ma [Sun, 1 Nov 2015 09:17:34 +0000 (04:17 -0500)]
internal/syscall/windows: add GetModuleFileName

For os.Executable. Updates #12773.

Change-Id: Iff6593514b7453b6c5e1f20079e35cb4992cc74a
Reviewed-on: https://go-review.googlesource.com/32877
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/internal/sys, runtime/internal/sys: gofmt
Michael Munday [Mon, 7 Nov 2016 20:57:04 +0000 (15:57 -0500)]
cmd/internal/sys, runtime/internal/sys: gofmt

Change-Id: Ice8f3b42194852f7ee8f00f004e80014d1ea119b
Reviewed-on: https://go-review.googlesource.com/32875
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/go: handle escapes in pkg-config output
Quentin Smith [Thu, 3 Nov 2016 22:45:01 +0000 (18:45 -0400)]
cmd/go: handle escapes in pkg-config output

This commit also adds a test for pkg-config usage in cgo.

Fixes #16455.

Change-Id: I95fb6a288a4d19093c4613c93878017d95cbe4a2
Reviewed-on: https://go-review.googlesource.com/32735
Run-TryBot: Quentin Smith <quentin@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocrypto/tls: use default cipher suites in BenchmarkThroughput
Michael Munday [Mon, 7 Nov 2016 20:40:48 +0000 (15:40 -0500)]
crypto/tls: use default cipher suites in BenchmarkThroughput

CL 32871 updated the default cipher suites to use AES-GCM in
preference to ChaCha20-Poly1305 on platforms which have hardware
implementations of AES-GCM. This change makes BenchmarkThroughput
use the default cipher suites instead of the test cipher suites to
ensure that the recommended (fastest) algorithms are used.

Updates #17779.

Change-Id: Ib551223e4a00b5ea197d4d73748e1fdd8a47c32d
Reviewed-on: https://go-review.googlesource.com/32838
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
8 years agogo/constant: follow-up for https://go-review.googlesource.com/32870
Robert Griesemer [Mon, 7 Nov 2016 19:20:48 +0000 (11:20 -0800)]
go/constant: follow-up for https://go-review.googlesource.com/32870

For #17812.

Change-Id: I58411aaa0e8b2250a16ddb20c951e39da3d601e8
Reviewed-on: https://go-review.googlesource.com/32872
Reviewed-by: Alan Donovan <adonovan@google.com>
8 years agoos: use extended-length paths on Windows when possible
Quentin Smith [Fri, 28 Oct 2016 17:01:51 +0000 (13:01 -0400)]
os: use extended-length paths on Windows when possible

Windows has a limit of 260 characters on normal paths, but it's possible
to use longer paths by using "extended-length paths" that begin with
`\\?\`. This commit attempts to transparently convert an absolute path
to an extended-length path, following the subtly different rules those
paths require. It does not attempt to handle relative paths, which
continue to be passed to the operating system unmodified.

This adds a new test, TestLongPath, to the os package. This test makes
sure that it is possible to write a path at least 400 characters long
and runs on every platform. It also tests symlinks and hardlinks, though
symlinks are not testable with our builder configuration.

HasLink is moved to internal/testenv so it can be used by multiple tests.

https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
has Microsoft's documentation on extended-length paths.

Fixes #3358.
Fixes #10577.
Fixes #17500.

Change-Id: I4ff6bb2ef9c9a4468d383d98379f65cf9c448218
Reviewed-on: https://go-review.googlesource.com/32451
Run-TryBot: Quentin Smith <quentin@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: os.Executable runtime support for Darwin
Shenghou Ma [Sun, 1 Nov 2015 09:16:52 +0000 (04:16 -0500)]
runtime: os.Executable runtime support for Darwin

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

8 years agosyscall: add Getexecname on Solaris for os.Executable
Shenghou Ma [Sun, 1 Nov 2015 09:18:26 +0000 (04:18 -0500)]
syscall: add Getexecname on Solaris for os.Executable

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

8 years agocrypto/{cipher,tls,internal/cryptohw}: prioritise AES-GCM when hardware support is...
Adam Langley [Mon, 7 Nov 2016 18:25:57 +0000 (10:25 -0800)]
crypto/{cipher,tls,internal/cryptohw}: prioritise AES-GCM when hardware support is present.

Support for ChaCha20-Poly1305 ciphers was recently added to crypto/tls.
These ciphers are preferable in software, but they cannot beat hardware
support for AES-GCM, if present.

This change moves detection for hardware AES-GCM support into
cipher/internal/cipherhw so that it can be used from crypto/tls. Then,
when AES-GCM hardware is present, the AES-GCM cipher suites are
prioritised by default in crypto/tls. (Some servers, such as Google,
respect the client's preference between AES-GCM and ChaCha20-Poly1305.)

Fixes #17779.

Change-Id: I50de2be486f0b0b8052c4628d3e3205a1d54a646
Reviewed-on: https://go-review.googlesource.com/32871
Run-TryBot: Adam Langley <agl@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agomime/multipart: test for overreading on a stream
Quentin Smith [Tue, 25 Oct 2016 19:41:14 +0000 (15:41 -0400)]
mime/multipart: test for overreading on a stream

Some multipart data arrives in a stream, where subsequent parts may not
be ready yet. Read should return a complete part as soon as
possible.

Fixes #15431

Change-Id: Ie8c041b853f3e07f0f2a66fbf4bcab5fe9132a7c
Reviewed-on: https://go-review.googlesource.com/32032
Run-TryBot: Quentin Smith <quentin@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/go: parallelize some tests
Brad Fitzpatrick [Mon, 7 Nov 2016 01:21:15 +0000 (01:21 +0000)]
cmd/go: parallelize some tests

Cuts tests from 35 to 25 seconds.

Many of these could be parallel if the test runner were modified to
give each test its own workdir cloned from the tempdir files they
use. But later. This helps for now.

Updates #17751

Change-Id: Icc2ff87cca60a33ec5fd8abb1eb0a9ca3e85bf95
Reviewed-on: https://go-review.googlesource.com/32850
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agogo/constant: improved fatal error messages
Robert Griesemer [Mon, 7 Nov 2016 18:43:25 +0000 (10:43 -0800)]
go/constant: improved fatal error messages

Fixes #17812.

Change-Id: I08202165dd3f72ae04420e7b6129b8b689e74f5c
Reviewed-on: https://go-review.googlesource.com/32870
Reviewed-by: Alan Donovan <adonovan@google.com>
8 years agounsafe: remove incorrect type conversion in docs
Ian Lance Taylor [Sun, 6 Nov 2016 18:35:58 +0000 (10:35 -0800)]
unsafe: remove incorrect type conversion in docs

Fixes #17818.

Change-Id: Id7242b0bdd5e1db254b44ae29900fc4f3362c743
Reviewed-on: https://go-review.googlesource.com/32828
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc: fix broken links in 1.7 release docs
Joe Farrell [Mon, 7 Nov 2016 18:43:13 +0000 (18:43 +0000)]
doc: fix broken links in 1.7 release docs

Change-Id: Ibf73ee7be4591393f4e08d464edfa325c3ec2c11
Reviewed-on: https://go-review.googlesource.com/32798
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/dist: enable more cgo tests on ppc64le
Michael Munday [Mon, 7 Nov 2016 16:50:48 +0000 (11:50 -0500)]
cmd/dist: enable more cgo tests on ppc64le

The tests all pass (for me at least) so I don't think there is any
reason not to enable them.

Change-Id: I96e71383e573273f442a849914cf6458ada14f82
Reviewed-on: https://go-review.googlesource.com/32855
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agotest/fixedbugs: enable issue 10607 test on ppc64le
Michael Munday [Mon, 7 Nov 2016 16:08:36 +0000 (11:08 -0500)]
test/fixedbugs: enable issue 10607 test on ppc64le

ppc64le supports both internal and external linking so I don't
think there is any reason for it to skip this test.

Change-Id: I05c80cc25909c0364f0a1fb7d20766b011ea1ebb
Reviewed-on: https://go-review.googlesource.com/32854
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/link: don't use trampolines in ppc64le ext linking
Lynn Boger [Fri, 4 Nov 2016 19:53:59 +0000 (14:53 -0500)]
cmd/link: don't use trampolines in ppc64le ext linking

On ppc64x, trampolines are used to resolve too-far
branches for internal linking.  The external linking,
solution on ppc64x is to split text sections when they
get too large, allowing the external linker to handle
the long branches.

On arm trampolines are generanted for too-far branches
for internal and external linking.  When the change
was made recently to enable trampolines for external linking
on arm, that broke the ppc64x fix for too-far branches
with external linking.

The fix adds a check to use trampolines only for internal
linking with ppc64x.

Fixes #17795

Change-Id: Icce968fb96545f10a913e07654514643bce96261
Reviewed-on: https://go-review.googlesource.com/32853
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
8 years agonet/http/fcgi: fix link to protocol docs
Brad Fitzpatrick [Mon, 7 Nov 2016 04:05:18 +0000 (04:05 +0000)]
net/http/fcgi: fix link to protocol docs

Fixes #17815

Change-Id: I766082d28a14c77f5dfb6cd1974b86cb0a8fe31a
Reviewed-on: https://go-review.googlesource.com/32852
Reviewed-by: Minux Ma <minux@golang.org>
8 years agoruntime/race: allow TestFail to run longer than 0.00s
Alex Brainman [Sun, 6 Nov 2016 07:43:49 +0000 (18:43 +1100)]
runtime/race: allow TestFail to run longer than 0.00s

Fixes #17811

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

8 years agocmd/vet: parallelize tests
Brad Fitzpatrick [Fri, 4 Nov 2016 19:12:09 +0000 (19:12 +0000)]
cmd/vet: parallelize tests

Was 2.3 seconds. Now 1.4 seconds.

Next win would be not running a child process and refactoring main so
it could be called from tests easily. But that would also require
rewriting the errchk written in Perl. This appears to be the last user
of errchk in the tree.

Updates #17751

Change-Id: Id7c3cec76f438590789b994e756f55b5397be07f
Reviewed-on: https://go-review.googlesource.com/32754
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
8 years agogo/constant: document that BinaryOp doesn't handle comparisons or shifts
Robert Griesemer [Sat, 5 Nov 2016 20:14:23 +0000 (13:14 -0700)]
go/constant: document that BinaryOp doesn't handle comparisons or shifts

Fixes #17797.

Change-Id: I544df81c4bcf3cbd36a793be40050f14f9a9974f
Reviewed-on: https://go-review.googlesource.com/32761
Reviewed-by: Dominik Honnef <dominik@honnef.co>
8 years agonet: fix vet nit
Josh Bleecher Snyder [Sat, 5 Nov 2016 17:05:27 +0000 (10:05 -0700)]
net: fix vet nit

net/fd_windows.go:121: syscall.WSABuf composite literal uses unkeyed fields

Change-Id: I91cbe38199d5b6828379a854d08f6ceaf687dd82
Reviewed-on: https://go-review.googlesource.com/32760
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agonet/http: deflake TestLinuxSendfile
Brad Fitzpatrick [Sat, 5 Nov 2016 00:25:38 +0000 (00:25 +0000)]
net/http: deflake TestLinuxSendfile

Fixes #17805

Change-Id: I30d3e63a82b3690a76f2bb33d59ae34c62a7fa59
Reviewed-on: https://go-review.googlesource.com/32759
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agonet/http: deflake TestClientRedirectTypes and maybe some similar ones
Brad Fitzpatrick [Sat, 5 Nov 2016 00:21:59 +0000 (00:21 +0000)]
net/http: deflake TestClientRedirectTypes and maybe some similar ones

A few tests were using the global DefaultTransport implicitly.
Be explicit instead. And then make some parallel while I'm there.

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

8 years agocmd/go/internal/syntax: reintroduce reverted comments
Robert Griesemer [Fri, 4 Nov 2016 23:37:24 +0000 (16:37 -0700)]
cmd/go/internal/syntax: reintroduce reverted comments

These comments were originally introduced together with the changes
for alias declarations, and then reverted when we backed out alias
support.

Reintroduce them.

Change-Id: I3ef2c4f4672d6af8a900f5d73df273edf28d1a14
Reviewed-on: https://go-review.googlesource.com/32826
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
8 years agoRevert "cmd/compile/internal/syntax: support for alias declarations"
Robert Griesemer [Fri, 4 Nov 2016 23:27:31 +0000 (16:27 -0700)]
Revert "cmd/compile/internal/syntax: support for alias declarations"

This reverts commit 32db3f2756324616b7c856ac9501deccc2491239.

Reason: Decision to back out current alias implementation.

For #16339.

Change-Id: Ib05e3d96041d8347e49cae292f66bec791a1fdc8
Reviewed-on: https://go-review.googlesource.com/32825
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
8 years agoRevert "go/scanner, go/token: recognize => (ALIAS) token"
Robert Griesemer [Fri, 4 Nov 2016 23:11:48 +0000 (16:11 -0700)]
Revert "go/scanner, go/token: recognize => (ALIAS) token"

This reverts commit 776a90100f1f65fcf54dfd3d082d657341bdc323.

Reason: Decision to back out current alias implementation.

For #16339.

Change-Id: Icb451a122c661ded05d9293356b466fa72b965f3
Reviewed-on: https://go-review.googlesource.com/32824
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
8 years agoRevert "go/ast, go/parser: parse alias declarations"
Robert Griesemer [Fri, 4 Nov 2016 23:04:11 +0000 (16:04 -0700)]
Revert "go/ast, go/parser: parse alias declarations"

This reverts commit 57ae83307fc4cb90338b39dcc6fe3c61ee8ce0b7.

Reason: Decision to back out current alias implementation.

For #16339.

Change-Id: I7bcc04ac87ea3590999e58ff65a7f2e1e6c6bc77
Reviewed-on: https://go-review.googlesource.com/32823
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
8 years agoplugin: fix doc example fmt usage
Leon Klingele [Fri, 4 Nov 2016 23:57:45 +0000 (00:57 +0100)]
plugin: fix doc example fmt usage

Change-Id: I0520a37a48a56d231a8ac2dc58b2bf1762282760
Reviewed-on: https://go-review.googlesource.com/32795
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoRevert "go/printer: support for printing alias declarations"
Robert Griesemer [Fri, 4 Nov 2016 22:59:48 +0000 (15:59 -0700)]
Revert "go/printer: support for printing alias declarations"

This reverts commit 59c63c711c73f3872c3047c2e80debba5ff1b802.

Reason: Decision to back out current alias implementation.

For #16339.

Change-Id: Idd135fe84b7ce4814cb3632f717736fc6985634c
Reviewed-on: https://go-review.googlesource.com/32822
Reviewed-by: Chris Manghane <cmang@golang.org>
8 years agoRevert "cmd/vet: teach vet about ast.AliasSpec"
Robert Griesemer [Sat, 5 Nov 2016 00:01:34 +0000 (17:01 -0700)]
Revert "cmd/vet: teach vet about ast.AliasSpec"

This reverts commit aa8c8e770e6db895405b66d38867c2368d94024a.

Reason: Decision to back out current alias implementation.

For #16339.

Change-Id: I4db9a8d6b3625c794be9d2f1ff0e9c047f383d28
Reviewed-on: https://go-review.googlesource.com/32827
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Chris Manghane <cmang@golang.org>
8 years agocmd/compile: revert user-visible changes related to aliases
Robert Griesemer [Fri, 4 Nov 2016 22:48:39 +0000 (15:48 -0700)]
cmd/compile: revert user-visible changes related to aliases

Reason: Decision to back out current alias implementation.

Leaving import/export related code in place for now.

For #16339.

TBR=mdempsky

Change-Id: Ib0897cab2c1c3dc8a541f2efb9893271b0b0efe2
Reviewed-on: https://go-review.googlesource.com/32757
Reviewed-by: Robert Griesemer <gri@golang.org>
8 years agocrypto/x509: update __MAC_OS_X_VERSION_MAX_ALLOWED on Mac
Brad Fitzpatrick [Wed, 2 Nov 2016 21:45:27 +0000 (14:45 -0700)]
crypto/x509: update __MAC_OS_X_VERSION_MAX_ALLOWED on Mac

Reportedly, -mmacosx-version-min=10.6 -D__MAC_OS_X_VERSION_MAX_ALLOWED=1060
is problematic.

It means min 10.6 and max 10.6, thus exactly 10.6. But we only support
10.8+.

It never caused us problems, because we build on Macs, but apparently
if you cross-compile from Linux with some Mac compiler SDK thing, then
things break?

This was added in https://golang.org/cl/5700083 for #3131, and the
intent at the time was to pin to exactly 10.6. So it wasn't a mistake,
but it is definitely outdated.

Given that we now support 10.8 as the min, update it to 1080.

Fixes #17732

Change-Id: I6cc8ab6ac62b8638a5025952b830f23e8822b2a6
Reviewed-on: https://go-review.googlesource.com/32580
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Quentin Smith <quentin@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

8 years agogo/types: revert user-visible changes related to aliases
Robert Griesemer [Fri, 4 Nov 2016 22:01:09 +0000 (15:01 -0700)]
go/types: revert user-visible changes related to aliases

Reason: Decision to back out current alias implementation.
For #16339 (comment).

Change-Id: Ie04f24e529db2d29c5dd2e36413f5f37f628df39
Reviewed-on: https://go-review.googlesource.com/32819
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
8 years agogo/types: avoid redundant call to recordUse for anonymous fields
Alan Donovan [Fri, 4 Nov 2016 21:11:51 +0000 (17:11 -0400)]
go/types: avoid redundant call to recordUse for anonymous fields

Anonymous fields are type expressions, and Checker.typexpr already
correctly records uses within them.  There's no need for a second
call, and the second call caused a bug when we implemented aliases.

Change-Id: I1bf2429cd4948d68b085e75dfb1bdc03ad8caffd
Reviewed-on: https://go-review.googlesource.com/32837
Reviewed-by: Robert Griesemer <gri@golang.org>
8 years agoall: make copyright headers consistent with one space after period
Michael Munday [Fri, 4 Nov 2016 20:30:12 +0000 (16:30 -0400)]
all: make copyright headers consistent with one space after period

Continuation of CL 20111.

Change-Id: Ie2f62237e6ec316989c021de9b267cc9d6ee6676
Reviewed-on: https://go-review.googlesource.com/32830
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile/internal/gc: add support for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:50:40 +0000 (23:50 +0200)]
cmd/compile/internal/gc: add support for GOARCH=mips{,le}

Change-Id: Ida4cd647525abce3441bfcb9fdee059344fe717f
Reviewed-on: https://go-review.googlesource.com/31477
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
8 years agoRevert "spec: add new language for alias declarations"
Robert Griesemer [Fri, 4 Nov 2016 19:38:53 +0000 (12:38 -0700)]
Revert "spec: add new language for alias declarations"

This reverts commit aff37662d1f70f2bf9e47b4f962e85521e7c18d1.

Reason: Decision to back out current alias implementation.
https://github.com/golang/go/issues/16339#issuecomment-258527920

Fixes #16339.
Fixes #17746.
Fixes #17784.

Change-Id: I5737b830d7f6fb79cf36f26403b4ad8533ba1dfe
Reviewed-on: https://go-review.googlesource.com/32813
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/link/internal/ld: add support for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:50:45 +0000 (23:50 +0200)]
cmd/link/internal/ld: add support for GOARCH=mips{,le}

Change-Id: Ida214ccc5858969ea60abb0787f4d98bab4336d6
Reviewed-on: https://go-review.googlesource.com/31480
TryBot-Result: Gobot Gobot <gobot@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
8 years agocmd/vet: add support for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:51:11 +0000 (23:51 +0200)]
cmd/vet: add support for GOARCH=mips{,le}

Change-Id: Ie7b40cc67e9901e252a4a48225bbd745a66d2673
Reviewed-on: https://go-review.googlesource.com/31511
Reviewed-by: Cherry Zhang <cherryyz@google.com>
8 years agoall: sprinkle t.Parallel on some slow tests
Brad Fitzpatrick [Fri, 4 Nov 2016 05:28:01 +0000 (05:28 +0000)]
all: sprinkle t.Parallel on some slow tests

I used the slowtests.go tool as described in
https://golang.org/cl/32684 on packages that stood out.

go test -short std drops from ~56 to ~52 seconds.

This isn't a huge win, but it was mostly an exercise.

Updates #17751

Change-Id: I9f3402e36a038d71e662d06ce2c1d52f6c4b674d
Reviewed-on: https://go-review.googlesource.com/32751
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agotest: disable unsupported test for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:51:12 +0000 (23:51 +0200)]
test: disable unsupported test for GOARCH=mips{,le}

External linking on mips/mipsle is not supported yet (issue #17792).

Change-Id: Ic25f4f8fe9e0ec35c72ca9f85c053b398df4952c
Reviewed-on: https://go-review.googlesource.com/31512
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime: remove useless assignment in test code
Ian Lance Taylor [Fri, 4 Nov 2016 13:43:48 +0000 (06:43 -0700)]
runtime: remove useless assignment in test code

Change-Id: I5fecdf52e9e3035ea8feb5768985ed5200dbd6af
Reviewed-on: https://go-review.googlesource.com/32752
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Martin Möhrmann <martisch@uos.de>
8 years agonet/http: move extra redirect logic for 307/308 into redirectBehavior
Emmanuel Odeke [Fri, 4 Nov 2016 04:17:45 +0000 (21:17 -0700)]
net/http: move extra redirect logic for 307/308 into redirectBehavior

Follow up of CL https://go-review.googlesource.com/32595.

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

8 years agonet/http: speed up tests, use t.Parallel when it's safe
Brad Fitzpatrick [Fri, 4 Nov 2016 03:23:37 +0000 (03:23 +0000)]
net/http: speed up tests, use t.Parallel when it's safe

Before: 8.9 seconds for go test -short
 After: 2.8 seconds

There are still 250 tests without t.Parallel, but I got the important
onces using a script:

    $ go test -short -v 2>&1 | go run ~/slowtests.go

Where slowtests.go is https://play.golang.org/p/9mh5Wg1nLN

The remaining 250 (the output lines from slowtests.go) all have a
reported duration of 0ms, except one 50ms test which has to be serial.

Where tests can't be parallel, I left a comment at the top saying why,
so people don't add t.Parallel later and get surprised at failures.

Updates #17751

Change-Id: Icbe32cbe2b996e23c89f1af6339287fa22af5115
Reviewed-on: https://go-review.googlesource.com/32684
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
8 years agocmd/go: fix minor typo in 'go bug'
Josh Bleecher Snyder [Fri, 4 Nov 2016 02:20:27 +0000 (19:20 -0700)]
cmd/go: fix minor typo in 'go bug'

Change-Id: I6bb594576e174cb0df8d25d11b84f5a4752ebfd6
Reviewed-on: https://go-review.googlesource.com/32683
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agonet/http: fix type name in comment
Brad Fitzpatrick [Fri, 4 Nov 2016 03:33:44 +0000 (03:33 +0000)]
net/http: fix type name in comment

Change-Id: Ia03f993287d2929f35b4c92d00fe25c7243bd8b3
Reviewed-on: https://go-review.googlesource.com/32685
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
8 years agonet/http: tweak the new Client 307/308 redirect behavior a bit
Brad Fitzpatrick [Thu, 3 Nov 2016 20:53:05 +0000 (20:53 +0000)]
net/http: tweak the new Client 307/308 redirect behavior a bit

This CL tweaks the new (unreleased) 307/308 support added in
https://golang.org/cl/29852 for #10767.

Change 1: if a 307/308 response doesn't have a Location header in its
response (as observed in the wild in #17773), just do what we used to
do in Go 1.7 and earlier, and don't try to follow that redirect.

Change 2: don't follow a 307/308 if we sent a body on the first
request and the caller's Request.GetBody func is nil so we can't
"rewind" the body to send it again.

Updates #17773 (will be fixed more elsewhere)

Change-Id: I183570f7346917828a4b6f7f1773094122a30406
Reviewed-on: https://go-review.googlesource.com/32595
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/objdump: speed up tests
Josh Bleecher Snyder [Thu, 3 Nov 2016 05:56:10 +0000 (22:56 -0700)]
cmd/objdump: speed up tests

Rebuild cmd/objdump once instead of twice.
Speeds up standalone 'go test cmd/objdump' on my
machine from ~1.4s to ~1s.

Updates #17751

Change-Id: I15fd79cf18c310f892bc28a9e9ca47ee010c989a
Reviewed-on: https://go-review.googlesource.com/32673
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: prevent Noalg from breaking user types
Matthew Dempsky [Thu, 3 Nov 2016 22:58:55 +0000 (15:58 -0700)]
cmd/compile: prevent Noalg from breaking user types

Use a separate symbol for reflect metadata for types with Noalg set.

Fixes #17752.

Change-Id: Icb6cade7e3004fc4108f67df61105dc4085cd7e2
Reviewed-on: https://go-review.googlesource.com/32679
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime/internal/sys: add arch defs for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:50:25 +0000 (23:50 +0200)]
runtime/internal/sys: add arch defs for GOARCH=mips{,le}

Change-Id: I6288f1fca1ae4c64b3907af700811ee842053020
Reviewed-on: https://go-review.googlesource.com/31472
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/internal/sys: add support for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:50:29 +0000 (23:50 +0200)]
cmd/internal/sys: add support for GOARCH=mips{,le}

Change-Id: I8c6b8839c68818430510702719dca15b8d748fb8
Reviewed-on: https://go-review.googlesource.com/31473
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agointernal/syscall/unix: add randomTrap const for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:50:59 +0000 (23:50 +0200)]
internal/syscall/unix: add randomTrap const for GOARCH=mips{,le}

Change-Id: I76c62a7b79ea526f59f281e933e4fd431539d2da
Reviewed-on: https://go-review.googlesource.com/31486
Reviewed-by: Cherry Zhang <cherryyz@google.com>
8 years agoruntime: 8-byte align the heap_live field for atomic access
Vladimir Stefanovic [Wed, 31 Aug 2016 14:58:56 +0000 (16:58 +0200)]
runtime: 8-byte align the heap_live field for atomic access

mheap_.heap_live is an atomically accessed uint64. It is currently not 8-byte
aligned on 32-bit platforms, which has been okay because it's only accessed via
Xadd64, which doesn't require alignment on 386 or ARM32. However, Xadd64 on
MIPS32 does require 8-byte alignment.

Add a padding field to force 8-byte alignment of heap_live and prevent an
alignment check crash on MIPS32.

Change-Id: I7eddf7883aec7a0a7e0525af5d58ed4338a401d0
Reviewed-on: https://go-review.googlesource.com/31635
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agosyscall: add support for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:51:03 +0000 (23:51 +0200)]
syscall: add support for GOARCH=mips{,le}

Change-Id: I39a46b2a9412981db1780b688a86fec791f68b6f
Reviewed-on: https://go-review.googlesource.com/31488
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
8 years agocmd/dist: add mips and mipsle as GOARCH values
Brad Fitzpatrick [Thu, 3 Nov 2016 22:45:06 +0000 (22:45 +0000)]
cmd/dist: add mips and mipsle as GOARCH values

Change-Id: I7a51d5d96a7cb87c40ade5be276136c465010bb9
Reviewed-on: https://go-review.googlesource.com/32596
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Vladimir Stefanovic <vladimir.stefanovic@imgtec.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

8 years agoreflect: add support for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:50:57 +0000 (23:50 +0200)]
reflect: add support for GOARCH=mips{,le}

Change-Id: I8b0c4bfe1e4c401d5c36a51b937671e6362c73a4
Reviewed-on: https://go-review.googlesource.com/31485
Reviewed-by: Cherry Zhang <cherryyz@google.com>
8 years agocmd/cgo: add support for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:50:54 +0000 (23:50 +0200)]
cmd/cgo: add support for GOARCH=mips{,le}

Change-Id: I47c6867fc653c8388ad32e210a8027baa592eda3
Reviewed-on: https://go-review.googlesource.com/31483
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agomath, math/big: add support for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:50:55 +0000 (23:50 +0200)]
math, math/big: add support for GOARCH=mips{,le}

Change-Id: I54e100cced5b49674937fb87d1e0f585f962aeb7
Reviewed-on: https://go-review.googlesource.com/31484
Reviewed-by: Cherry Zhang <cherryyz@google.com>
8 years agosync/atomic: add support for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:51:06 +0000 (23:51 +0200)]
sync/atomic: add support for GOARCH=mips{,le}

Change-Id: I10f36710dd95b9bd31b3b82a3c32edcadb90ffa9
Reviewed-on: https://go-review.googlesource.com/31510
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
8 years agoruntime/internal/atomic: add GOARCH=mips{,le} support
Vladimir Stefanovic [Tue, 18 Oct 2016 21:51:04 +0000 (23:51 +0200)]
runtime/internal/atomic: add GOARCH=mips{,le} support

Change-Id: I99a48f719fd1a8178fc59787084a074e91c89ac6
Reviewed-on: https://go-review.googlesource.com/31489
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
8 years agodebug/elf: add support for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:50:48 +0000 (23:50 +0200)]
debug/elf: add support for GOARCH=mips{,le}

Change-Id: Ia6f8ae7e56a49ad66b60a24c4afb606f3cfe5efd
Reviewed-on: https://go-review.googlesource.com/31482
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
8 years agotesting: add T.Context method
Brad Fitzpatrick [Sat, 22 Oct 2016 14:25:21 +0000 (07:25 -0700)]
testing: add T.Context method

From the doc comment:

Context returns the context for the current test or benchmark.
The context is cancelled when the test or benchmark finishes.
A goroutine started during a test or benchmark can wait for the
context's Done channel to become readable as a signal that the
test or benchmark is over, so that the goroutine can exit.

Fixes #16221.
Fixes #17552.

Change-Id: I657df946be2c90048cc74615436c77c7d9d1226c
Reviewed-on: https://go-review.googlesource.com/31724
Reviewed-by: Rob Pike <r@golang.org>
8 years agocontext: adjust tests to avoid importing "testing" in package context
Russ Cox [Thu, 3 Nov 2016 19:01:30 +0000 (15:01 -0400)]
context: adjust tests to avoid importing "testing" in package context

So that testing can use context in its public API.

For #16221.

Change-Id: I6263fa7266c336c9490f20164ce79336df44a57e
Reviewed-on: https://go-review.googlesource.com/32648
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoencoding/json: example on MarshalJSON, UnmarshalJSON
Emmanuel Odeke [Thu, 22 Sep 2016 06:11:28 +0000 (23:11 -0700)]
encoding/json: example on MarshalJSON, UnmarshalJSON

Updates #16360.

Change-Id: I5bf13d3367e68c5d8435f6ef2161d5a74cc747a7
Reviewed-on: https://go-review.googlesource.com/29611
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agotesting: mark tests and benchmarks failed if a race occurs during execution
Russ Cox [Thu, 3 Nov 2016 01:40:47 +0000 (21:40 -0400)]
testing: mark tests and benchmarks failed if a race occurs during execution

Before:

$ go test -race -v -run TestRace
=== RUN   TestRace
==================
WARNING: DATA RACE
Write at 0x00c420076420 by goroutine 7:
  _/Users/rsc/go/src/cmd/go/testdata/src/testrace.TestRace.func1()
      /Users/rsc/go/src/cmd/go/testdata/src/testrace/race_test.go:10 +0x3b

Previous write at 0x00c420076420 by goroutine 6:
  _/Users/rsc/go/src/cmd/go/testdata/src/testrace.TestRace()
      /Users/rsc/go/src/cmd/go/testdata/src/testrace/race_test.go:13 +0xcc
  testing.tRunner()
      /Users/rsc/go/src/testing/testing.go:656 +0x104

Goroutine 7 (running) created at:
  _/Users/rsc/go/src/cmd/go/testdata/src/testrace.TestRace()
      /Users/rsc/go/src/cmd/go/testdata/src/testrace/race_test.go:12 +0xbb
  testing.tRunner()
      /Users/rsc/go/src/testing/testing.go:656 +0x104

Goroutine 6 (running) created at:
  testing.(*T).Run()
      /Users/rsc/go/src/testing/testing.go:693 +0x536
  testing.runTests.func1()
      /Users/rsc/go/src/testing/testing.go:877 +0xaa
  testing.tRunner()
      /Users/rsc/go/src/testing/testing.go:656 +0x104
  testing.runTests()
      /Users/rsc/go/src/testing/testing.go:883 +0x4ac
  testing.(*M).Run()
      /Users/rsc/go/src/testing/testing.go:818 +0x1c3
  main.main()
      _/Users/rsc/go/src/cmd/go/testdata/src/testrace/_test/_testmain.go:42 +0x20f
==================
--- PASS: TestRace (0.00s)
PASS
Found 1 data race(s)
FAIL _/Users/rsc/go/src/cmd/go/testdata/src/testrace 1.026s
$

After:

$ go test -race -v -run TestRace
=== RUN   TestRace
==================
WARNING: DATA RACE
Write at 0x00c420076420 by goroutine 7:
  _/Users/rsc/go/src/cmd/go/testdata/src/testrace.TestRace.func1()
      /Users/rsc/go/src/cmd/go/testdata/src/testrace/race_test.go:10 +0x3b

Previous write at 0x00c420076420 by goroutine 6:
  _/Users/rsc/go/src/cmd/go/testdata/src/testrace.TestRace()
      /Users/rsc/go/src/cmd/go/testdata/src/testrace/race_test.go:13 +0xcc
  testing.tRunner()
      /Users/rsc/go/src/testing/testing.go:656 +0x104

Goroutine 7 (running) created at:
  _/Users/rsc/go/src/cmd/go/testdata/src/testrace.TestRace()
      /Users/rsc/go/src/cmd/go/testdata/src/testrace/race_test.go:12 +0xbb
  testing.tRunner()
      /Users/rsc/go/src/testing/testing.go:656 +0x104

Goroutine 6 (running) created at:
  testing.(*T).Run()
      /Users/rsc/go/src/testing/testing.go:693 +0x536
  testing.runTests.func1()
      /Users/rsc/go/src/testing/testing.go:877 +0xaa
  testing.tRunner()
      /Users/rsc/go/src/testing/testing.go:656 +0x104
  testing.runTests()
      /Users/rsc/go/src/testing/testing.go:883 +0x4ac
  testing.(*M).Run()
      /Users/rsc/go/src/testing/testing.go:818 +0x1c3
  main.main()
      _/Users/rsc/go/src/cmd/go/testdata/src/testrace/_test/_testmain.go:42 +0x20f
==================
--- FAIL: TestRace (0.00s)
testing.go:609: race detected during execution of test
FAIL
FAIL _/Users/rsc/go/src/cmd/go/testdata/src/testrace 0.022s
$

Fixes #15972.

Change-Id: Idb15b8ab81d65637bb535c7e275595ca4a6e450e
Reviewed-on: https://go-review.googlesource.com/32615
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agonet/http: support If-Match in ServeContent
Dan Harrington [Tue, 25 Oct 2016 19:51:39 +0000 (12:51 -0700)]
net/http: support If-Match in ServeContent

- Added support for If-Match and If-Unmodified-Since.
- Precondition checks now more strictly follow RFC 7232 section 6, which
affects precedence when multiple condition headers are present.
- When serving a 304, Last-Modified header is now removed when no ETag is
present (as suggested by RFC 7232 section 4.1).
- If-None-Match supports multiple ETags.
- ETag comparison now correctly handles weak ETags.

Fixes #17572

Change-Id: I35039dea6811480ccf2889f8ed9c6a39ce34bfff
Reviewed-on: https://go-review.googlesource.com/32014
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agogo/internal/gcimporter: backport changes from x/tools/go/gcimporter15
Robert Griesemer [Thu, 3 Nov 2016 17:47:44 +0000 (10:47 -0700)]
go/internal/gcimporter: backport changes from x/tools/go/gcimporter15

See https://go-review.googlesource.com/32581.

This makes x/tools/go/gcimporter15/bimport.go a close copy again
and the importer more robust.

Change-Id: If96ad6acd611878b7dfa6a13d005d847ece82ab6
Reviewed-on: https://go-review.googlesource.com/32647
TryBot-Result: Gobot Gobot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
8 years agocmd/compile: don't panic if syntax.ReadFile returns an error
Mohit Agarwal [Thu, 3 Nov 2016 16:55:42 +0000 (22:25 +0530)]
cmd/compile: don't panic if syntax.ReadFile returns an error

Fixes #17772

Change-Id: I0f2094400c454828aa57a8d172dadeac4ddb6d35
Reviewed-on: https://go-review.googlesource.com/32691
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime/cgo: correct type declaration for Windows
David Chase [Thu, 3 Nov 2016 15:50:14 +0000 (11:50 -0400)]
runtime/cgo: correct type declaration for Windows

Newer versions of gcc notice a type mismatch and complain.
Fix code to match documented signature in MSDN.
Trybots say this still compiles with the older (5.1) version
of gcc.

Fixes #17771.

Change-Id: Ib3fe6f71b40751e1146249e31232da5ac69b9e00
Reviewed-on: https://go-review.googlesource.com/32646
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocrypto/x509: expose UnknownAuthorityError.Cert
Russ Cox [Thu, 3 Nov 2016 13:39:32 +0000 (09:39 -0400)]
crypto/x509: expose UnknownAuthorityError.Cert

This matches exposing CertificateInvalidError.Cert.
and (exposing but not the spelling of) HostnameError.Certificate.

Fixes #13519.

Change-Id: Ifae9a09e063d642c09de3cdee8a728ff06d3a5df
Reviewed-on: https://go-review.googlesource.com/32644
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/cgo: add #line directives to avoid printing bogus references to Go source files
Russ Cox [Wed, 2 Nov 2016 23:41:01 +0000 (19:41 -0400)]
cmd/cgo: add #line directives to avoid printing bogus references to Go source files

A bit contrived to come up with an example, but it happened in #15836, somehow.

$ cat /tmp/x.go
package main

/*
#include <stddef.h>

int foo(void);

int foo(void) {
return 2;
}

#define int asdf
*/
import "C"

func main() {
println(C.foo())
}

$ go run /tmp/x.go
# command-line-arguments
cgo-builtin-prolog:9:31: error: unknown type name 'asdf'   <<<<<
_GoString_ GoStringN(char *p, int l);
                              ^
/tmp/x.go:12:13: note: expanded from macro 'int'
#define int asdf
            ^
cgo-builtin-prolog:10:28: error: unknown type name 'asdf'  <<<<<
_GoBytes_ GoBytes(void *p, int n);
                           ^
/tmp/x.go:12:13: note: expanded from macro 'int'
#define int asdf
            ^
2 errors generated.

The two marked lines used to refer incorrectly to /tmp/x.go.

Fixes #15836.

Change-Id: I08ef60a53cfd148112fceb651eaf7b75d94a7a8d
Reviewed-on: https://go-review.googlesource.com/32613
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/cover: change covered block for switch/select case to exclude expression
Russ Cox [Thu, 3 Nov 2016 00:18:47 +0000 (20:18 -0400)]
cmd/cover: change covered block for switch/select case to exclude expression

Consider a switch like

switch x {
case foo:
f()
g()
}

Before, the coverage annotation for the block calling f and g included
in its position span the text for 'case foo:'. This looks nice in the coverage
report, but it breaks the invariant that coverage blocks are disjoint if
you have a more complex expression like:

switch x {
case func() int { return foo }():
f()
g()
}

Then the coverage analysis wants to annotate the func literal body,
which overlaps with the case body, because the case body is considered
to begin at the case token.

Change the annotation for a case body to start just after the colon of
the case clause, avoiding any potential conflict with complex case
expressions. Could have started at the colon instead, but it seemed
less weird to start just after it.

Fixes #16540.

Change-Id: I1fec4bc2a53c7092e649dc0d4be1680a697cb79b
Reviewed-on: https://go-review.googlesource.com/32612
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocmd/go: clear GIT_ALLOW_PROTOCOL during tests
Russ Cox [Thu, 3 Nov 2016 03:12:10 +0000 (23:12 -0400)]
cmd/go: clear GIT_ALLOW_PROTOCOL during tests

Clear it before any tests begin.
Clear it again after TestIsSecureGitAllowProtocol sets it.

Fixes #17700.

Change-Id: I6ea50d37f8222d8c7c9fee0b1eac3bbdfb5d133e
Reviewed-on: https://go-review.googlesource.com/32640
Reviewed-by: Quentin Smith <quentin@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>

8 years agocmd/go: fix TestIssue11457
Russ Cox [Thu, 3 Nov 2016 03:18:54 +0000 (23:18 -0400)]
cmd/go: fix TestIssue11457

The goal of the test is to provoke a custom import path check error,
which will contain the current repo path, to see that it says ssh:// in it.

But the fix to #16471 made the test no longer provoke that error.
Provoke the error by checking out from rsc.io instead of github.com/rsc.

Fixes #17701.

Change-Id: I750ffda2ff59c2be8e111d26160997214a73fd9a
Reviewed-on: https://go-review.googlesource.com/32641
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: remove .o and .a files in builder.collect
Russ Cox [Thu, 3 Nov 2016 03:22:18 +0000 (23:22 -0400)]
cmd/go: remove .o and .a files in builder.collect

This matches the removal of .so files and makes the processing
of '-L/path/to -lfoo' and plain '/path/to/foo.a' match.

Fixes #16463.

Change-Id: I1464c5390d7eb6a3a33b4b2c951f87ef392ec94a
Reviewed-on: https://go-review.googlesource.com/32642
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoencoding/asn1: document that default:x tag only has meaning with optional tag
Russ Cox [Wed, 26 Oct 2016 16:18:00 +0000 (12:18 -0400)]
encoding/asn1: document that default:x tag only has meaning with optional tag

Fixes #16712.

Change-Id: Ib216059c6c0c952162c19e080dcf3799f0652a8d
Reviewed-on: https://go-review.googlesource.com/32171
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Quentin Smith <quentin@golang.org>
8 years agomisc/cgo/testsanitizers: skip tests when vm.overcommit_memory=2
Russ Cox [Wed, 2 Nov 2016 20:33:33 +0000 (16:33 -0400)]
misc/cgo/testsanitizers: skip tests when vm.overcommit_memory=2

Fixes #17689.

Change-Id: I45a14e6bf4b2647431105f3e0b63b7076b6655d2
Reviewed-on: https://go-review.googlesource.com/32635
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agotime: document that only Jan and January, Mon and Monday are recognized
Russ Cox [Wed, 2 Nov 2016 21:19:42 +0000 (17:19 -0400)]
time: document that only Jan and January, Mon and Monday are recognized

Not "J", not "JAN", not "jan", etc.

Fixes #17523.

Change-Id: I16b5da97e73d88c6680c36401d30f8a195061527
Reviewed-on: https://go-review.googlesource.com/32636
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/go: fix coverage in xtest of cgo package
Russ Cox [Thu, 3 Nov 2016 01:15:41 +0000 (21:15 -0400)]
cmd/go: fix coverage in xtest of cgo package

Cover-annotated cgo-rebuilt package for xtest was
not linked into package graph and so not being rebuilt.
Link into package graph.

Fixes #13625.

Change-Id: I685f7276f92bbc85fbc4b389111c83d9fe517637
Reviewed-on: https://go-review.googlesource.com/32614
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: fix TestGoGetDashTIssue8181
Russ Cox [Thu, 3 Nov 2016 01:52:27 +0000 (21:52 -0400)]
cmd/go: fix TestGoGetDashTIssue8181

The test case was importing golang.org/x/build/cmd/cl,
which is a package main and cannot be imported.
The test case (stored in a separate repo) has been changed
to import golang.org/x/build/gerrit. Update the test accordingly.

Fixes #17702.

Change-Id: I80e150092111b5a04bb00c992b32edb271edb086
Reviewed-on: https://go-review.googlesource.com/32616
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: use new HTTP-only server insecure.go-get-issue-15410.appspot.com instead...
Russ Cox [Thu, 3 Nov 2016 03:01:20 +0000 (23:01 -0400)]
cmd/go: use new HTTP-only server insecure.go-get-issue-15410.appspot.com instead of wh3rd.net

Fixes #15410.

Change-Id: I9964d0162a3cae690afeb889b1822cf79c80b89a
Reviewed-on: https://go-review.googlesource.com/32639
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocmd/compile: update/remove outdated comments
Robert Griesemer [Thu, 3 Nov 2016 03:34:29 +0000 (20:34 -0700)]
cmd/compile: update/remove outdated comments

Change-Id: I5a74be1593dca8ba5e0829f0bae35dc9ce702671
Reviewed-on: https://go-review.googlesource.com/32672
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
8 years agoruntime/testdata/testprog: increase GCFairness2 timeout to 1s
Quentin Smith [Wed, 2 Nov 2016 20:18:22 +0000 (16:18 -0400)]
runtime/testdata/testprog: increase GCFairness2 timeout to 1s

OpenBSD's scheduler causes preemption to take 20+ms, so 30ms is not
enough time for 3 goroutines to run. This change continues to sleep for
30ms, but if it finds that the 3 goroutines have not run, it sleeps for
an additional 1s before declaring failure.

Updates #17712

Change-Id: I3e886e40d05192b7cb71b4f242af195836ef62a8
Reviewed-on: https://go-review.googlesource.com/32634
Reviewed-by: Rick Hudson <rlh@golang.org>
Run-TryBot: Quentin Smith <quentin@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/vet/all: add s390x support
Josh Bleecher Snyder [Thu, 3 Nov 2016 01:16:51 +0000 (18:16 -0700)]
cmd/vet/all: add s390x support

Some of these whitelist entries could be
eliminated, e.g. by the addition of Go
declarations, but this is a start.

Change-Id: I2fb3234cf05ebc6b161aacac2d4c15d810d50527
Reviewed-on: https://go-review.googlesource.com/32671
Reviewed-by: Michael Munday <munday@ca.ibm.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime: fix s390x asm frame sizes
Josh Bleecher Snyder [Thu, 3 Nov 2016 02:02:43 +0000 (19:02 -0700)]
runtime: fix s390x asm frame sizes

Found by vet.

Change-Id: I1d78454facdd3522509ecfe7c73b21c4602ced8a
Reviewed-on: https://go-review.googlesource.com/32670
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Munday <munday@ca.ibm.com>
8 years agoall: update s390x assembly to use vet-friendly names
Josh Bleecher Snyder [Thu, 3 Nov 2016 02:02:15 +0000 (19:02 -0700)]
all: update s390x assembly to use vet-friendly names

No functional changes.

Change-Id: Ibf592c04be506a76577d48574e84ab20c3238b49
Reviewed-on: https://go-review.googlesource.com/32589
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Munday <munday@ca.ibm.com>