]> Cypherpunks repositories - gostls13.git/log
gostls13.git
8 years agonet/http: update bundled http2 for ErrAbortHandler support, document it more
Brad Fitzpatrick [Thu, 10 Nov 2016 23:16:14 +0000 (23:16 +0000)]
net/http: update bundled http2 for ErrAbortHandler support, document it more

Updates http2 to x/net/http2 git rev 0e2717d for:

   http2: conditionally log stacks from panics in Server Handlers like net/http
   https://golang.org/cl/33102

Fixes #17790

Change-Id: Idd3f0c65540398d41b412a33f1d80de3f7f31409
Reviewed-on: https://go-review.googlesource.com/33103
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
8 years agonet/http: deflake TestClientTimeout
Brad Fitzpatrick [Thu, 10 Nov 2016 23:03:06 +0000 (23:03 +0000)]
net/http: deflake TestClientTimeout

This test was only enabled by default today so it hasn't been hardened
by build.golang.org. Welcome to the ring, TestClientTimeout.

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

8 years agonet/http: update Transport doc example to not disable http2
Brad Fitzpatrick [Thu, 10 Nov 2016 21:16:31 +0000 (21:16 +0000)]
net/http: update Transport doc example to not disable http2

The old Transport example ended up disabling HTTP/2.

Use a better example.

Fixes #17051
Fixes #17296

Change-Id: I6feca168744131916e8bf56c829b4d4b50e304ee
Reviewed-on: https://go-review.googlesource.com/33094
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agonet/http: update bundled http2
Brad Fitzpatrick [Thu, 10 Nov 2016 22:53:16 +0000 (22:53 +0000)]
net/http: update bundled http2

Updates http2 to x/net/http2 git rev 9ef22118 for:

   http2: fix CloseNotify data race
   https://golang.org/cl/33013

   http2: don't overflow stream IDs in server push
   https://golang.org/cl/32488

   http2: disable server push on receiving a GOAWAY
   https://golang.org/cl/32887

   http2: fix state tracking for pushed streams
   https://golang.org/cl/32755

Change-Id: Ie7d675857423c102c9ec164d3c943093c749c7cf
Reviewed-on: https://go-review.googlesource.com/33100
Reviewed-by: Tom Bergan <tombergan@google.com>
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: add ErrAbortHandler, make Server quiet if used as panic value
Brad Fitzpatrick [Thu, 10 Nov 2016 22:49:16 +0000 (22:49 +0000)]
net/http: add ErrAbortHandler, make Server quiet if used as panic value

Add an explicit way for Handlers to abort their response to the client
and also not spam their error log with stack traces.

panic(nil) also worked in the past (for http1 at least), so continue
to make that work (and test it). But ErrAbortHandler is more explicit.

Updates #17790 (needs http2 updates also)

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

8 years agonet/http: document that Server.Close and Shutdown don't track hijacked conns
Brad Fitzpatrick [Thu, 10 Nov 2016 21:35:01 +0000 (21:35 +0000)]
net/http: document that Server.Close and Shutdown don't track hijacked conns

Fixes #17721

Change-Id: I19fd81c9909a22b01a4dc9c75f3f0e069c8608ca
Reviewed-on: https://go-review.googlesource.com/33095
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodebug/elf: SPARC64 relocation type is only 8 bits
Ian Lance Taylor [Thu, 10 Nov 2016 20:49:06 +0000 (12:49 -0800)]
debug/elf: SPARC64 relocation type is only 8 bits

https://docs.oracle.com/cd/E53394_01/html/E54813/chapter6-54839.html#OSLLGchapter6-24:

"For 64–bit SPARC Elf64_Rela structures, the r_info field is further
broken down into an 8–bit type identifier and a 24–bit type dependent
data field. For the existing relocation types, the data field is
zero. New relocation types, however, might make use of the data bits.

 #define ELF64_R_TYPE_ID(info)         (((Elf64_Xword)(info)<<56)>>56)
"

No test for this because the only test would be an invalid object file.

Change-Id: I5052ca3bfaf0759e920f9a24a16fd97543b24486
Reviewed-on: https://go-review.googlesource.com/33091
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
8 years agonet/http: document and deprecate type and errors of type ProtocolError
Brad Fitzpatrick [Thu, 10 Nov 2016 22:12:50 +0000 (22:12 +0000)]
net/http: document and deprecate type and errors of type ProtocolError

Clean up & document the ProtocolError gunk.

Fixes #17558

Change-Id: I5e54c25257907c9cac7433f7a5bdfb176e8c3eee
Reviewed-on: https://go-review.googlesource.com/33096
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: remove "x" in TestImportMain
Ian Lance Taylor [Thu, 10 Nov 2016 20:58:16 +0000 (12:58 -0800)]
cmd/go: remove "x" in TestImportMain

Interestingly, this only became a problem when CL 32850 marked
TestImportMain as parallel.  Before that, "x" was overwritten and remove
in a later test, TestGoBuildOutput.  The latter test is not marked as
parallel, so now it is run first.  It is rather fragile for two tests to
compete over the same filename, but this change is correct regardless.

Change-Id: I1db7929c0bc20a2fd0cc6a02999bef2dca9e0cc0
Reviewed-on: https://go-review.googlesource.com/33092
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agonet/http: fix documentation on Server.TLSNextProto controlling http2
Brad Fitzpatrick [Thu, 10 Nov 2016 20:28:14 +0000 (20:28 +0000)]
net/http: fix documentation on Server.TLSNextProto controlling http2

Server.TLSNextProto being nil is necessary but not sufficient but
http2 being automatically enabled.

Fixes #16588

Change-Id: I5b18690582f9b12ef05b58235e1eaa52483be285
Reviewed-on: https://go-review.googlesource.com/33090
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoruntime/pprof: output CPU profiles in pprof protobuf format
Michael Matloob [Thu, 10 Nov 2016 18:31:41 +0000 (13:31 -0500)]
runtime/pprof: output CPU profiles in pprof protobuf format

This change buffers the entire profile and converts in one shot
in the profile writer, and could use more memory than necessary
to output protocol buffer formatted profiles. It should be
possible to convert each chunk in a stream (maybe maintaining
some minimal state to output in the end) which could save on
memory usage.

Fixes #16093

Change-Id: I946c6a2b044ae644c72c8bb2d3bd82c415b1a847
Reviewed-on: https://go-review.googlesource.com/33071
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agonet/http: don't wrap request cancellation errors in timeouts
Emmanuel Odeke [Tue, 1 Nov 2016 07:44:48 +0000 (00:44 -0700)]
net/http: don't wrap request cancellation errors in timeouts

Based on Filippo Valsorda's https://golang.org/cl/24230

Fixes #16094

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

8 years agocmd/vet: detect defer resp.Body.Close() before error check
Francesc Campoy [Tue, 8 Nov 2016 07:37:21 +0000 (23:37 -0800)]
cmd/vet: detect defer resp.Body.Close() before error check

This check detects the code

resp, err := http.Get("http://foo.com")
defer resp.Body.Close()
if err != nil {
...
}

For every call to a function on the net/http package or any method
on http.Client that returns (*http.Response, error), it checks
whether the next line is a defer statement that calls on the response.

Fixes #17780.

Change-Id: I9d70edcbfa2bad205bf7f45281597d074c795977
Reviewed-on: https://go-review.googlesource.com/32911
Reviewed-by: Rob Pike <r@golang.org>
8 years agoA+C: update for Go 1.8
Brad Fitzpatrick [Thu, 10 Nov 2016 17:49:19 +0000 (17:49 +0000)]
A+C: update for Go 1.8

Add Albert Nigmatzianov (individual CLA)
Add Alex Browne (individual CLA)
Add Alex Carol (individual CLA)
Add Alexander Döring (individual CLA)
Add Allan Simon (individual CLA)
Add Alok Menghrajani (individual CLA)
Add Andreas Auernhammer (individual CLA)
Add Andreas Litt (individual CLA)
Add Andrew Pogrebnoy (individual CLA)
Add Antonio Murdaca (corporate CLA for Red Hat, Inc.)
Add Atin Malaviya (individual CLA)
Add Billy Lynch (corporate CLA for Google Inc.)
Add Blixt (individual CLA)
Add Boris Nagaev (corporate CLA for Google Inc.)
Add Braden Bassingthwaite (corporate CLA for Vendasta)
Add Brian Kennedy (individual CLA)
Add Bryan Alexander (individual CLA)
Add Carl Johnson (individual CLA)
Add Cixtor (individual CLA)
Add Cyrill Schumacher (individual CLA)
Add Daniel Martí (individual CLA)
Add Daria Kolistratova (corporate CLA for Intel Corporation)
Add David Hubbard (corporate CLA for Google Inc.)
Add David Stainton (individual CLA)
Add Deepak Jois (individual CLA)
Add Denis Nagorny (corporate CLA for Intel Corporation)
Add Dhaivat Pandit (individual CLA)
Add Dhananjay Nakrani (corporate CLA for Google Inc.)
Add Dmitri Popov (individual CLA)
Add Erik Staab (corporate CLA for Google Inc.)
Add Ethan Miller (corporate CLA for IBM)
Add Faiyaz Ahmed (individual CLA)
Add Fedor Indutny (individual CLA)
Add Gabriel Russell (individual CLA)
Add Gareth Paul Jones (individual CLA)
Add Geoffroy Lorieux (individual CLA)
Add Gleb Stepanov (individual CLA)
Add Henrik Hodne (individual CLA)
Add Ivan Babrou (individual CLA)
Add Jack Lindamood (corporate CLA for Amazon.com, Inc)
Add James Clarke (individual CLA)
Add Jamie Beverly (individual CLA)
Add Jason Smale (individual CLA)
Add Jean-Nicolas Moal (individual CLA)
Add Jeroen Bobbeldijk (individual CLA)
Add Jim Kingdon (corporate CLA for Bolt)
Add Jirka Daněk (individual CLA)
Add Jon Chen (corporate CLA for Amazon.com, Inc)
Add Joonas Kuorilehto (individual CLA)
Add Josh Chorlton (individual CLA)
Add Joshua Boelter (corporate CLA for Intel Corporation)
Add Justyn Temme (individual CLA)
Add Kale Blankenship (individual CLA)
Add LE Manh Cuong (individual CLA)
Add Luigi Riefolo (individual CLA)
Add Manfred Touron (individual CLA)
Add Martin Bertschler (individual CLA)
Add Martin Hamrle (individual CLA)
Add Matthew Denton (individual CLA)
Add Matthieu Hauglustaine (individual CLA)
Add Michael Darakananda (corporate CLA for Google Inc.)
Add Mike Appleby (individual CLA)
Add Mike Houston (individual CLA)
Add Mike Strosaker (corporate CLA for IBM)
Add Miroslav Genov (individual CLA)
Add Momchil Velikov (individual CLA)
Add Nick Harper (corporate CLA for Google Inc.)
Add Oleg Vakheta (individual CLA)
Add Parker Moore (individual CLA)
Add Prasanna Swaminathan (corporate CLA for MediaMath, Inc)
Add Radu Berinde (individual CLA)
Add Ramesh Dharan (corporate CLA for Google Inc.)
Add Richard Gibson (individual CLA)
Add Samuel Tan (corporate CLA for Google Inc.)
Add Samuele Pedroni (individual CLA)
Add Sarah Adams (corporate CLA for Google Inc.)
Add Sean Rees (individual CLA)
Add Simon Rawet (individual CLA)
Add Sina Siadat (individual CLA)
Add Song Gao (individual CLA)
Add Suyash (individual CLA)
Add Sven Blumenstein (corporate CLA for Google Inc.)
Add Syohei YOSHIDA (individual CLA)
Add Terrel Shumway (individual CLA)
Add Than McIntosh (corporate CLA for Google Inc.)
Add Thomas de Zeeuw (individual CLA)
Add Tim Henderson (individual CLA)
Add Tom Wilkie (corporate CLA for Weaveworks)
Add Trey Lawrence (individual CLA)
Add Tristan Ooohry (individual CLA)
Add Tuo Shan (corporate CLA for Google Inc.)
Add Victor Chudnovsky (corporate CLA for Google Inc.)
Add Vitor De Mario (individual CLA)
Add Vladimir Mihailenco (individual CLA)
Add Vladimir Stefanovic (individual CLA)
Add Walter Poupore (corporate CLA for Google Inc.)
Add Xuyang Kang (individual CLA)
Add Zev Goldstein (individual CLA)

Updates #12042

Change-Id: I28d63babe225683b88f3f1501e529aed636c9ead
Reviewed-on: https://go-review.googlesource.com/33028
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agolib/time: update tzdata to 2016i
Brad Fitzpatrick [Thu, 10 Nov 2016 18:00:10 +0000 (18:00 +0000)]
lib/time: update tzdata to 2016i

Fixes #17678

Change-Id: I01d12a827e6106efed1ec024f736c640b86906b4
Reviewed-on: https://go-review.googlesource.com/33029
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: -ldflags=-linkmode=external requires runtime/cgo
Ian Lance Taylor [Thu, 10 Nov 2016 17:59:42 +0000 (09:59 -0800)]
cmd/go: -ldflags=-linkmode=external requires runtime/cgo

We add runtime/cgo to the list of import paths for various cases that
imply external linking mode, but before this change we did not add for
an explicit request of external linking mode. This fixes the case where
you are using a non-default buildmode that implies a different
compilation option (for example, -buildmode=pie implies -shared) and the
runtime/cgo package for that option is stale.

No test, as I'm not sure how to write one. It would require forcing a
stale runtime/cgo.

Change-Id: Id0409c7274ce67fe15d910baf587d3220cb53d83
Reviewed-on: https://go-review.googlesource.com/33070
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
8 years agogo/printer: don't drop required semi/linebreak after /*-comment
Robert Griesemer [Wed, 9 Nov 2016 22:15:59 +0000 (14:15 -0800)]
go/printer: don't drop required semi/linebreak after /*-comment

For details, see the issues.

Fixes #11274.
Fixes #15137.

Change-Id: Ia11e71a054b3195e3007f490418a9c53a7e9cdf1
Reviewed-on: https://go-review.googlesource.com/33016
Reviewed-by: Alan Donovan <adonovan@google.com>
8 years agonet/http: fix Server.Close double Lock
Brad Fitzpatrick [Thu, 10 Nov 2016 16:43:15 +0000 (16:43 +0000)]
net/http: fix Server.Close double Lock

Fixes #17878

Change-Id: I062ac514239068c58175c9ee7964b3590f956a82
Reviewed-on: https://go-review.googlesource.com/33026
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoreflect: unexported fields are tied to a package
David Crawshaw [Fri, 4 Nov 2016 22:22:06 +0000 (18:22 -0400)]
reflect: unexported fields are tied to a package

An unexported field of a struct is not visible outside of the package
that defines it, so the package path is implicitly part of the
definition of any struct with an unexported field.

Change-Id: I17c6aac822bd0c24188ab8ba1cc406d6b5d82771
Reviewed-on: https://go-review.googlesource.com/32820
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agosync: add example for Pool
Kevin Burke [Wed, 22 Jun 2016 17:00:31 +0000 (10:00 -0700)]
sync: add example for Pool

It was a little tricky to figure out how to go from the documentation
to figuring out the best way to implement a Pool, so I thought I'd
try to provide a simple example. The implementation is mostly taken
from the fmt package.

I'm not happy with the verbosity of the calls to WriteString() etc,
but I wanted to provide a non-trivial example.

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

8 years agocmd/gofmt: don't leave tmp file if -w failed
Robert Griesemer [Thu, 10 Nov 2016 01:02:33 +0000 (17:02 -0800)]
cmd/gofmt: don't leave tmp file if -w failed

Follow-up on https://golang.org/cl/33018.

For #8984.

Change-Id: I6655a5537a60d4ea3ee13029a56a75b150f8c8f8
Reviewed-on: https://go-review.googlesource.com/33020
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/gofmt: don't eat source if -w fails
Robert Griesemer [Wed, 9 Nov 2016 23:29:41 +0000 (15:29 -0800)]
cmd/gofmt: don't eat source if -w fails

Write output to a temp file first and only upon success
rename that file to source file name.

Fixes #8984.

Change-Id: Ie40e49d2a4eb3c9462fe769ccbf055b4366eceb0
Reviewed-on: https://go-review.googlesource.com/33018
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agogo/types: remove unused alias-related testdata files
Robert Griesemer [Thu, 10 Nov 2016 00:11:50 +0000 (16:11 -0800)]
go/types: remove unused alias-related testdata files

They interfere with gofmt -w across this directory.

Follow-up on https://go-review.googlesource.com/32819.

For #16339 (comment).

Change-Id: I4298b6117d89517d4fe6addce3942d950d821817
Reviewed-on: https://go-review.googlesource.com/33019
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
8 years agonet/http: deflake TestIdleConnH2Crash
Brad Fitzpatrick [Wed, 9 Nov 2016 21:35:37 +0000 (21:35 +0000)]
net/http: deflake TestIdleConnH2Crash

Fixes #17838

Change-Id: Ifafb4542a0ed6f2e29c9a83e30842e2fc18d6546
Reviewed-on: https://go-review.googlesource.com/33015
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
Reviewed-by: Michael Munday <munday@ca.ibm.com>
8 years agosyscall: use 32-bit setuid/setgid syscalls on linux/{386,arm}
Brad Fitzpatrick [Wed, 9 Nov 2016 20:35:46 +0000 (20:35 +0000)]
syscall: use 32-bit setuid/setgid syscalls on linux/{386,arm}

Fixes #17092

Change-Id: Ib14e4db13116ebbe4d72c414fb979d27a06d6174
Reviewed-on: https://go-review.googlesource.com/33011
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoencoding/xml: check type when unmarshaling innerxml field
Quentin Smith [Tue, 8 Nov 2016 21:47:04 +0000 (16:47 -0500)]
encoding/xml: check type when unmarshaling innerxml field

We only support unmarshaling into a string or a []byte, but we
previously would try (and panic while) setting a slice of a different
type. The docs say ",innerxml" is ignored if the type is not string or
[]byte, so do that for other slices as well.

Fixes #15600.

Change-Id: Ia64815945a14c3d04a0a45ccf413e38b58a69416
Reviewed-on: https://go-review.googlesource.com/32919
Run-TryBot: Quentin Smith <quentin@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime/pprof/internal/protopprof: skip TestTranslateCPUProfileWithSamples if < 2...
Michael Munday [Tue, 8 Nov 2016 22:11:18 +0000 (17:11 -0500)]
runtime/pprof/internal/protopprof: skip TestTranslateCPUProfileWithSamples if < 2 mappings

A Go binary may only have 1 executable memory region if it has been
linked using internal linking. This change means that the test will
be skipped if this is the case, rather than fail.

Fixes #17852.

Change-Id: I59459a0f90ae8963aeb9908e5cb9fb64d7d0e0f4
Reviewed-on: https://go-review.googlesource.com/32920
Run-TryBot: Michael Munday <munday@ca.ibm.com>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
8 years agocmd/compile/internal/syntax: fix error handling for Read/Parse calls
Robert Griesemer [Wed, 9 Nov 2016 00:01:56 +0000 (16:01 -0800)]
cmd/compile/internal/syntax: fix error handling for Read/Parse calls

- define syntax.Error for cleaner error reporting
- abort parsing after first error if no error handler is installed
- make sure to always report the first error, if any
- document behavior of API calls
- while at it: rename ReadXXX -> ParseXXX (clearer)
- adjust cmd/compile noder.go accordingly

Fixes #17774.

Change-Id: I7893eedea454a64acd753e32f7a8bf811ddbb03c
Reviewed-on: https://go-review.googlesource.com/32950
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
8 years agocmd/cgo: delete unused variable in log statement
Josh Bleecher Snyder [Sun, 6 Nov 2016 19:58:49 +0000 (11:58 -0800)]
cmd/cgo: delete unused variable in log statement

visit is just a func, and there's no formatting
verb for it, and it's on an internal-error path.
It has been thus many years, unchanged and unexecuted.

Change-Id: I4c2e2673ee9996218c24143bcc3be3eb4abdff25
Reviewed-on: https://go-review.googlesource.com/32970
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoC: add Martin Möhrmann's google.com email (Google CLA)
Martin Möhrmann [Wed, 9 Nov 2016 08:24:50 +0000 (09:24 +0100)]
C: add Martin Möhrmann's google.com email (Google CLA)

Change-Id: Ia439c4a3c873ef24f60f8ee54a74f767fdaafd29
Reviewed-on: https://go-review.googlesource.com/32799
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/compile: ensure that knownFormats is up to date
Josh Bleecher Snyder [Wed, 9 Nov 2016 00:10:26 +0000 (16:10 -0800)]
cmd/compile: ensure that knownFormats is up to date

Change-Id: I4febdddfe5be569a8bba0a4cddf52dec7f1be1bf
Reviewed-on: https://go-review.googlesource.com/32930
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoos: on Windows, don't fix long paths that aren't long
Brad Fitzpatrick [Tue, 8 Nov 2016 01:06:06 +0000 (01:06 +0000)]
os: on Windows, don't fix long paths that aren't long

Notably, don't allocate.

Follow-up to https://golang.org/cl/32451 which added long path
cleaning.

Updates #3358

Change-Id: I89c59cbd660d0a030f31b6acd070fa9f3250683b
Reviewed-on: https://go-review.googlesource.com/32886
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/link: add support for GOARCH=mips{,le}
Vladimir Stefanovic [Tue, 18 Oct 2016 21:50:47 +0000 (23:50 +0200)]
cmd/link: add support for GOARCH=mips{,le}

Only internal linking without cgo is supported for now.

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

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

Change-Id: I632d4aef7295778ba5018d98bcb06a68bcf07ce1
Reviewed-on: https://go-review.googlesource.com/31478
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
8 years agoruntime/pprof/internal: add package protopprof
Michael Matloob [Fri, 4 Nov 2016 15:27:54 +0000 (11:27 -0400)]
runtime/pprof/internal: add package protopprof

This change adds code, originally written by Russ Cox <rsc@golang.org>
and open-sourced by Google, that converts from the "legacy"
binary pprof profile format to a struct representation of the
new protocol buffer pprof profile format.

This code reads the entire binary format for conversion to the
protobuf format. In a future change, we will update the code
to incrementally read and convert segments of the binary format,
so that the entire profile does not need to be stored in memory.

This change also contains contributions by Daria Kolistratova
<daria.kolistratova@intel.com> from the rolled-back change
golang.org/cl/30556 adapting the code to be used by the package
runtime/pprof.

This code also appeared in the change golang.org/cl/32257, which was based
on Daria Kolistratova's change, but was also rolled back.

Updates #16093

Change-Id: I5c768b1134bc15408d80a3ccc7ed867db9a1c63d
Reviewed-on: https://go-review.googlesource.com/32811
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
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>