1
0
mirror of https://github.com/golang/go synced 2024-11-12 01:50:22 -07:00
Commit Graph

28570 Commits

Author SHA1 Message Date
Jeff R. Allen
2f9eeea212 cmd/go: document testdata directory in "go help test"
Document the correct use of the testdata directory
where test writers might be expecting to find it.

It seems that alldocs.go was out of date, so it
has picked up some other changes with this commit.

Fixes #14715.

Change-Id: I0a22676bb7a64b2a61b56495f7ea38db889d8b37
Reviewed-on: https://go-review.googlesource.com/23353
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-24 19:05:09 +00:00
David Crawshaw
a0abecf102 cmd/link: ensure -fuse-ld=gold uses gold
Fixes #15696

Change-Id: I134e918dc56f79a72a04aa54f415371884113d2a
Reviewed-on: https://go-review.googlesource.com/23400
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-05-24 18:56:11 +00:00
Marcel van Lohuizen
7b9d3ff4cb testing: don't be silent if a test's goroutine fails a test after test exits
Fixes #15654

Change-Id: I9bdaa9b76d480d75f24d95f0235efd4a79e3593e
Reviewed-on: https://go-review.googlesource.com/23320
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2016-05-24 16:27:47 +00:00
Aliaksandr Valialkin
dcc42c7d11 cmd/vet: do not check print-like functions with unknown type
Fixes #15787

Change-Id: I559ba886527b474dbdd44fe884c78973b3012377
Reviewed-on: https://go-review.googlesource.com/23351
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-05-24 16:13:44 +00:00
Russ Cox
524956f8b9 io: remove SizedReaderAt
It's not clear we want to enshrine an io interface in which Size cannot
return an error. Because this requires more thought before committing
to the API, remove from Go 1.7.

Fixes #15818.

Change-Id: Ic4138ffb0e033030145a12d33f78078350a8381f
Reviewed-on: https://go-review.googlesource.com/23392
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
2016-05-24 15:37:27 +00:00
Russ Cox
ba867a86fa api: update next.txt
Change-Id: I7b38309d927409a92f68f5d26f491b0166eba838
Reviewed-on: https://go-review.googlesource.com/23378
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
2016-05-24 15:37:21 +00:00
Russ Cox
f117a5359a doc: first draft of Go 1.7 release notes
Mostly complete but a few TODOs remain for future CLs.

For #15810.

Change-Id: I81ee19d1088d192cf709a5f7e6b7bcc44ad892ac
Reviewed-on: https://go-review.googlesource.com/23379
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
2016-05-24 15:36:15 +00:00
Russ Cox
85e3c9e6b8 cmd/compile, go/types: omit needless word in error message
CL 21462 and CL 21463 made this message say explicitly that the problem
was a struct field in a map, but the word "directly" is unnecessary,
sounds wrong, and makes the error long.

Change-Id: I2fb68cdaeb8bd94776b8022cf3eae751919ccf6f
Reviewed-on: https://go-review.googlesource.com/23373
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2016-05-24 15:07:16 +00:00
Russ Cox
34b17d4dc5 encoding/json: rename Indent method to SetIndent
CL 21057 added this method during the Go 1.7 cycle
(so it is not yet released and still possible to revise).

This makes it clearer that the method is not doing something
(like func Indent does), but just changing a setting about doing
something later.

Also document that this is in some sense irreversible.
I think that's probably a mistake but the original CL discussion
claimed it as a feature, so I'll leave it alone.

For #6492.

Change-Id: If4415c869a9196501056c143811a308822d5a420
Reviewed-on: https://go-review.googlesource.com/23295
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
2016-05-24 15:01:29 +00:00
Russ Cox
4aea7a12b6 encoding/json: change DisableHTMLEscaping to SetEscapeHTML
DisableHTMLEscaping is now SetEscapeHTML, allowing the escaping
to be toggled, not just disabled. This API is new for Go 1.7,
so there are no compatibility concerns (quite the opposite,
the point is to fix the API before we commit to it in Go 1.7).

Change-Id: I96b9f8f169a9c44995b8a157a626eb62d0b6dea7
Reviewed-on: https://go-review.googlesource.com/23293
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-05-24 14:25:43 +00:00
Russ Cox
658814fa38 A+C: add Andre Nathan (individual CLA)
Andre wrote https://golang.org/cl/13454043 (never submitted),
which served as the basis for Ross Light's https://golang.org/cl/19235.

Individual CLA verified by hand.

Change-Id: Ic09e8efd84b7ded3ae472c204133e40cb85d97f7
Reviewed-on: https://go-review.googlesource.com/23377
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-24 13:54:49 +00:00
Russ Cox
7f9255c212 net: revise IP.String result for malformed IP address to add ? back
In earlier versions of Go the result was simply "?".
A change in this cycle made the result echo back the hex bytes
of the address, which is certainly useful, but now the result is
not clearly indicating an error. Put the "?" back, at the beginning
of the hex string, to make the invalidity of the string clearer.

Change-Id: I3e0f0b6a005601cd98d982a62288551959185b40
Reviewed-on: https://go-review.googlesource.com/23376
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-24 13:54:31 +00:00
Russ Cox
8e724e7bba cmd/go: fix //go:binary-only-package check
The use of a prefix check was too liberal.
Noted in review after submit.

Change-Id: I4fe1df660997efd225609e818040b8392fab79f0
Reviewed-on: https://go-review.googlesource.com/23375
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-24 13:54:24 +00:00
Russ Cox
1261023637 encoding/json: additional tests and fixes for []typedByte encoding/decoding
CL 19725 changed the encoding of []typedByte to look for
typedByte.MarshalJSON and typedByte.MarshalText.
Previously it was handled like []byte, producing a base64 encoding of the underlying byte data.

CL 19725 forgot to look for (*typedByte).MarshalJSON and (*typedByte).MarshalText,
as the marshaling of other slices would. Add test and fix for those.

This CL also adds tests that the decoder can handle both the old and new encodings.
(This was true even in Go 1.6, which is the only reason we can consider this
not an incompatible change.)

For #13783.

Change-Id: I7cab8b6c0154a7f2d09335b7fa23173bcf856c37
Reviewed-on: https://go-review.googlesource.com/23294
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-05-24 13:35:36 +00:00
Russ Cox
ab4414773e math/big: write t*10 to multiply t by 10
The compiler has caught up.
In fact the compiler is ahead; it knows about a magic multiply-by-5 instruction:

	// compute '0' + byte(r - t*10) in AX
	MOVQ	t, AX
	LEAQ	(AX)(AX*4), AX
	SHLQ	$1, AX
	MOVQ	r, CX
	SUBQ	AX, CX
	LEAL	48(CX), AX

For comparison, the shifty version compiles to:

	// compute '0' + byte(r - t*10) in AX
	MOVQ	t, AX
	MOVQ	AX, CX
	SHLQ	$3, AX
	MOVQ	r, DX
	SUBQ	AX, DX
	SUBQ	CX, DX
	SUBQ	CX, DX
	LEAL	48(DX), AX

Fixes #2671.

Change-Id: Ifbf23dbfeb19c0bb020fa44eb2f025943969fb6b
Reviewed-on: https://go-review.googlesource.com/23372
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-24 13:34:20 +00:00
Keith Randall
7a9f6c2b56 cmd/compile: benchmark needs dominator tree
Now that CSE uses dom tree to order partitions, we need the
dom tree computed before benchmarking CSE.

Fixes #15801

Change-Id: Ifa4702c7b75250f34de185e69a880b3f3cc46a12
Reviewed-on: https://go-review.googlesource.com/23361
Reviewed-by: David Chase <drchase@google.com>
2016-05-23 20:21:15 +00:00
Robert Griesemer
30fc940c70 go/types: don't drop type in n:1 var decl if one is given
In n:1 variable declarations (multiple lhs variables with single
multi-valued initialization expression) where also a variable
type is provided, make sure that that type is assigned to all
variables on the lhs before the init expression assignment is
checked. Otherwise, (some) variables are assumed to take the type
of the corresponding value of the multi-valued init expression.

Fixes #15755.

Change-Id: I969cb5a95c85e28dbb38abd7fa7df16ff5554c03
Reviewed-on: https://go-review.googlesource.com/23313
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-05-23 18:19:40 +00:00
Kenny Grant
65adb6ab9a time: run genzabbrs.go with new source data
The source xml data has changed, so running genzabbrs.go
regenerates a new time zone file in zoneinfo_abbrs_windows.go
which adds some zones and adjusts others.

Now set export ZONEINFO=$GOROOT/lib/time/zoneinfo.zip to use zoneinfo.zip in go tip.

Change-Id: I19f72359cc808094e5dcb420e480a00c6b2205d7
Reviewed-on: https://go-review.googlesource.com/23321
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-23 18:14:21 +00:00
djherbis
4b6e560b69 AUTHORS: correcting my last name Herbis -> Herbison
Change-Id: I91608b15e00c8eaf732db3a99a890d4ceeb41955
Reviewed-on: https://go-review.googlesource.com/23317
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-05-22 01:41:05 +00:00
Brad Fitzpatrick
1f8d276898 A+C: automated update (subrepos)
Add Abe Haskins (individual CLA)
Add Ahmy Yulrizka (individual CLA)
Add Akihiro Suda (individual CLA)
Add Alex Vaghin (corporate CLA for Google Inc.)
Add Arlo Breault (individual CLA)
Add Audrey Lim (individual CLA)
Add Benjamin Wester (corporate CLA for Square, Inc.)
Add Bryan Chan (corporate CLA for IBM)
Add Christy Perez (corporate CLA for IBM)
Add Colin Edwards (individual CLA)
Add David Brophy (individual CLA)
Add David Sansome (individual CLA)
Add Diwaker Gupta (individual CLA)
Add Doug Anderson (corporate CLA for Google Inc.)
Add Dustin Carlino (corporate CLA for Google Inc.)
Add Ernest Chiang (individual CLA)
Add Ethan Burns (corporate CLA for Google Inc.)
Add Gary Elliott (corporate CLA for Google Inc.)
Add Hallgrimur Gunnarsson (corporate CLA for Google Inc.)
Add Hironao OTSUBO (individual CLA)
Add Holden Huang (individual CLA)
Add Idora Shinatose (individual CLA)
Add Irieda Noboru (individual CLA)
Add Jeff Craig (corporate CLA for Google Inc.)
Add Joe Henke (individual CLA)
Add John Schnake (individual CLA)
Add Jonathan Amsterdam (corporate CLA for Google Inc.)
Add Kenji Kaneda (individual CLA)
Add Kenneth Shaw (individual CLA)
Add Mark Severson (individual CLA)
Add Martin Garton (individual CLA)
Add Mathias Leppich (individual CLA)
Add Maxwell Krohn (individual CLA)
Add Niall Sheridan (individual CLA)
Add Nick Patavalis (individual CLA)
Add Nick Petroni (individual CLA)
Add Omar Jarjur (corporate CLA for Google Inc.)
Add Özgür Kesim (individual CLA)
Add Peter Gonda (corporate CLA for Google Inc.)
Add Pierre Durand (individual CLA)
Add Quentin Smith (corporate CLA for Google Inc.)
Add Ricardo Padilha (individual CLA)
Add Riku Voipio (corporate CLA for Linaro Limited)
Add Roland Shoemaker (individual CLA)
Add Sam Hug (individual CLA)
Add Sam Whited (individual CLA)
Add Sami Commerot (corporate CLA for Google Inc.)
Add Scott Mansfield (corporate CLA for Netflix, Inc.)
Add Sean Harger (corporate CLA for Google Inc.)
Add Simon Jefford (individual CLA)
Add Sridhar Venkatakrishnan (individual CLA)
Add Tim Swast (corporate CLA for Google Inc.)
Add Timothy Studd (individual CLA)
Add Tipp Moseley (corporate CLA for Google Inc.)
Add Toby Burress (corporate CLA for Google Inc.)
Add Tzu-Jung Lee (corporate CLA for Currant)
Add Vadim Grek (individual CLA)
Add Xudong Zhang (individual CLA)

Updates #12042

Change-Id: I4119a8829119a2b8a9abbea9f52ceebb04878764
Reviewed-on: https://go-review.googlesource.com/23306
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-05-21 01:30:43 +00:00
Brad Fitzpatrick
def50f8e48 net/http: update bundled http2
Updates x/net/http2 to git rev 0c607074 for https://golang.org/cl/23311,
"http2: prevent Server from sending status 100 header after anything else"

New test is in the x/net/http2 package (not bundled to std).

Fixes #14030

Change-Id: Ifc6afa4a5fe35977135428f6d0e9f7c164767720
Reviewed-on: https://go-review.googlesource.com/23312
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-21 01:29:57 +00:00
Mikio Hara
82ec4cd79f net: don't crash DNS flood test on darwin
Also renames the test function to TestDNSFlood.

Updates #15659.

Change-Id: Ia562004c43bcc19c2fee9440321c27b591f85da5
Reviewed-on: https://go-review.googlesource.com/23077
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-21 00:23:53 +00:00
Brad Fitzpatrick
da5ac69bd4 A+C: automated updates
Add Aiden Scandella (individual CLA)
Add Alessandro Arzilli (individual CLA)
Add Augusto Roman (individual CLA)
Add Brady Catherman (individual CLA)
Add Brady Sullivan (individual CLA)
Add Caio Marcelo de Oliveira Filho (corporate CLA for Intel Corporation)
Add Catalin Nicutar (corporate CLA for Google Inc.)
Add Cherry Zhang (corporate CLA for Google Inc.)
Add Chris Zou (corporate CLA for IBM)
Add Christopher Nelson (individual CLA)
Add Conrad Irwin (individual CLA)
Add Cuihtlauac ALVARADO (corporate CLA for Orange)
Add Daniel Speichert (individual CLA)
Add Datong Sun (individual CLA)
Add Denys Honsiorovskyi (individual CLA)
Add Derek Shockey (individual CLA)
Add Dmitriy Dudkin (individual CLA)
Add Dustin Herbis (individual CLA)
Add Frits van Bommel (individual CLA)
Add Harshavardhana (individual CLA)
Add Hitoshi Mitake (individual CLA)
Add James Bardin (individual CLA)
Add James Chacon (corporate CLA for Google Inc.)
Add Jamil Djadala (individual CLA)
Add Jess Frazelle (individual CLA)
Add Joe Sylve (individual CLA)
Add Johan Sageryd (individual CLA)
Add John Jeffery (individual CLA)
Add Julia Hansbrough (corporate CLA for Google Inc.)
Add Jure Ham (corporate CLA for Zemanta d.o.o.)
Add Kamal Aboul-Hosn (corporate CLA for Google Inc.)
Add Kevin Burke (individual CLA)
Add Kevin Kirsche (individual CLA)
Add Kevin Vu (individual CLA)
Add Lee Hinman (individual CLA)
Add Luan Santos (individual CLA)
Add Marc-Antoine Ruel (corporate CLA for Google Inc.)
Add Matt Robenolt (individual CLA)
Add Michael McConville (individual CLA)
Add Michael Munday (corporate CLA for IBM)
Add Michael Pratt (corporate CLA for Google Inc.)
Add Michel Lespinasse (corporate CLA for Google Inc.)
Add Mike Danese (corporate CLA for Google Inc.)
Add Mikhail Gusarov (individual CLA)
Add Monty Taylor (individual CLA)
Add Morten Siebuhr (individual CLA)
Add Muhammed Uluyol (individual CLA)
Add Niels Widger (individual CLA)
Add Niko Dziemba (individual CLA)
Add Olivier Poitrey (individual CLA)
Add Paul Wankadia (corporate CLA for Google Inc.)
Add Philip Hofer (individual CLA)
Add Prashant Varanasi (individual CLA)
Add Rhys Hiltner (corporate CLA for Amazon.com, Inc)
Add Richard Miller (individual CLA)
Add Scott Bell (individual CLA)
Add Shahar Kohanim (individual CLA)
Add Shinji Tanaka (individual CLA)
Add Suharsh Sivakumar (corporate CLA for Google Inc.)
Add Tal Shprecher (individual CLA)
Add Tilman Dilo (individual CLA)
Add Tim Ebringer (individual CLA)
Add Tom Bergan (corporate CLA for Google Inc.)
Add Vishvananda Ishaya (individual CLA)
Add Wedson Almeida Filho (corporate CLA for Google Inc.)
Add Zhongwei Yao (corporate CLA for ARM Ltd.)

Updates #12042

Change-Id: Ia118adc2eb38e5ffc8448de2d9dd3ca792ee7227
Reviewed-on: https://go-review.googlesource.com/23303
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-05-20 23:06:16 +00:00
Brad Fitzpatrick
7ab698b022 time: document that After uses memory until duration times out
Fixes #15698

Change-Id: I616fc06dcf04092bafdaf56fb1afba2a998a6d83
Reviewed-on: https://go-review.googlesource.com/23304
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-05-20 22:51:51 +00:00
Robert Griesemer
054a721dca cmd/compile: read safemode bit from package header
Ignore respective bit in export data, but leave the info to
minimize format changes for 1.7. Scheduled to remove by 1.8.

For #15772.

Change-Id: Ifb3beea655367308a4e2d5dc8cb625915f904287
Reviewed-on: https://go-review.googlesource.com/23285
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-05-20 21:41:50 +00:00
Brad Fitzpatrick
cc0d8c86e3 net/http: deflake TestTransportEventTrace_h2
Fixes #15765

Change-Id: Id0a89d90ef9d3fffa9af0affca8c10a26fe6b7bc
Reviewed-on: https://go-review.googlesource.com/23284
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-20 21:40:02 +00:00
Brad Fitzpatrick
db5af0d711 net/http: update bundled http2
Updates x/net/http2 to git rev 4d07e8a49 for CL 23287:

   http2: let handlers close Request.Body without killing streams
   https://golang.org/cl/23287

Fixes #15425

Change-Id: I20b6e37cd09aa1d5a040c122ca0daf14b8916559
Reviewed-on: https://go-review.googlesource.com/23301
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-20 21:20:00 +00:00
Brad Fitzpatrick
4cad610401 os/exec: remove Cmd.RunContext and Cmd.WaitContext, add CommandContext
Fixes #15775

Change-Id: I0a6c2ca09d3850c3538494711f7a9801b9500411
Reviewed-on: https://go-review.googlesource.com/23300
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-20 21:19:32 +00:00
Brad Fitzpatrick
85e39f8387 net/http: also clone DynamicRecordSizingDisabled in cloneTLSConfig
Updates #15771

Change-Id: I5dad96bdca19d680dd00cbd17b72a03e43eb557e
Reviewed-on: https://go-review.googlesource.com/23283
Reviewed-by: Tom Bergan <tombergan@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-20 17:10:18 +00:00
David Crawshaw
be1b930653 reflect: hide unexported methods that do not satisfy interfaces
Fixes #15673

Change-Id: Ib36d8db3299a93d92665dbde012d52c2c5332ac0
Reviewed-on: https://go-review.googlesource.com/23253
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-20 14:36:14 +00:00
Brad Fitzpatrick
b3bf2e7803 net/http: update bundled http2
Updates x/net/http2 to git rev 8a52c78 for golang.org/cl/23258
(http2: fix Transport.CloseIdleConnections when http1+http2 are wired together)

Fixes #14607

Change-Id: I038badc69e230715b8ce4e398eb5e6ede73af918
Reviewed-on: https://go-review.googlesource.com/23280
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-20 05:53:06 +00:00
Jess Frazelle
1ded9fdcff syscall: fix unshare test on mips
Change-Id: Iedce3770a92112802f3a45c7b95ee145ab5b187e
Reviewed-on: https://go-review.googlesource.com/23282
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2016-05-20 05:52:35 +00:00
Brad Fitzpatrick
16f846a9cb net/http: update bundled http2
Updates x/net/http2 to git rev 202ff482 for https://golang.org/cl/23235 (Expect:
100-continue support for HTTP/2)

Fixes a flaky test too, and changes the automatic HTTP/2 behavior to
no longer special-case the DefaultTransport, because
ExpectContinueTimeout is no longer unsupported by the HTTP/2
transport.

Fixes #13851
Fixes #15744

Change-Id: I3522aace14179a1ca070fd7063368a831167a0f7
Reviewed-on: https://go-review.googlesource.com/23254
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-05-20 02:57:18 +00:00
Mikio Hara
9cd2c700de net: deflake TestDialTimeoutMaxDuration
Fixes #15745.

Change-Id: I6f9a1dcf0b1d97cb443900c7d8da09ead83d4b6a
Reviewed-on: https://go-review.googlesource.com/23243
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-05-20 01:26:21 +00:00
Jess Frazelle
8527b8ef9b syscall: add Unshare flags to SysProcAttr on Linux
This patch adds Unshare flags to SysProcAttr for Linux systems.

Fixes #1954

Change-Id: Id819c3f92b1474e5a06dd8d55f89d74a43eb770c
Reviewed-on: https://go-review.googlesource.com/23233
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-05-20 00:51:46 +00:00
Robert Griesemer
448246adff cmd/compile: don't exit early because of hidden error messages
Non-syntax errors are always counted to determine if to exit
early, but then deduplication eliminates them. This can lead
to situations which report "too many errors" and only one
error is shown.

De-duplicate non-syntax errors early, at least the ones that
appear consecutively, and only count the ones actually being
shown. This doesn't work perfectly as they may not appear in
sequence, but it's cheap and good enough.

Fixes #14136.

Change-Id: I7b11ebb2e1e082f0d604b88e544fe5ba967af1d7
Reviewed-on: https://go-review.googlesource.com/23259
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-05-19 23:17:54 +00:00
Brad Fitzpatrick
dc4427f372 context: make DeadlineExceeded have a Timeout method
Fixes #14238

Change-Id: I1538bfb5cfa63e36a89df1f6eb9f5a0dcafb6ce5
Reviewed-on: https://go-review.googlesource.com/23256
Reviewed-by: Dave Cheney <dave@cheney.net>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-19 23:09:16 +00:00
Brad Fitzpatrick
0b80659832 net/http/httptest: restore historic ResponseRecorder.HeaderMap behavior
In Go versions 1 up to and including Go 1.6,
ResponseRecorder.HeaderMap was both the map that handlers got access
to, and was the map tests checked their results against. That did not
mimic the behavior of the real HTTP server (Issue #8857), so HeaderMap
was changed to be a snapshot at the first write in
https://golang.org/cl/20047. But that broke cases where the Handler
never did a write (#15560), so revert the behavior.

Instead, introduce the ResponseWriter.Result method, returning an
*http.Response. It subsumes ResponseWriter.Trailers which was added
for Go 1.7 in CL 20047. Result().Header now contains the correct
answer, and HeaderMap is unchanged in behavior from previous Go
releases, so we don't break people's tests. People wanting the correct
behavior can use ResponseWriter.Result.

Fixes #15560
Updates #8857

Change-Id: I7ea9b56a6b843103784553d67f67847b5315b3d2
Reviewed-on: https://go-review.googlesource.com/23257
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-19 23:02:34 +00:00
Brad Fitzpatrick
3b50adbc4f build: unset GOBIN during build
Fixes #14340

Change-Id: I43e1624fafc972fb868708c3857fc8acf1bfbbd7
Reviewed-on: https://go-review.googlesource.com/23255
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-05-19 18:40:53 +00:00
Austin Clements
44497ebacb runtime: fix goroutine priority elevation
Currently it's possible for user code to exploit the high scheduler
priority of the GC worker in conjunction with the runnext optimization
to elevate a user goroutine to high priority so it will always run
even if there are other runnable goroutines.

For example, if a goroutine is in a tight allocation loop, the
following can happen:

1. Goroutine 1 allocates, triggering a GC.
2. G 1 attempts an assist, but fails and blocks.
3. The scheduler runs the GC worker, since it is high priority.
   Note that this also starts a new scheduler quantum.
4. The GC worker does enough work to satisfy the assist.
5. The GC worker readies G 1, putting it in runnext.
6. GC finishes and the scheduler runs G 1 from runnext, giving it
   the rest of the GC worker's quantum.
7. Go to 1.

Even if there are other goroutines on the run queue, they never get a
chance to run in the above sequence. This requires a confluence of
circumstances that make it unlikely, though not impossible, that it
would happen in "real" code. In the test added by this commit, we
force this confluence by setting GOMAXPROCS to 1 and GOGC to 1 so it's
easy for the test to repeated trigger GC and wake from a blocked
assist.

We fix this by making GC always put user goroutines at the end of the
run queue, instead of in runnext. This makes it so user code can't
piggy-back on the GC's high priority to make a user goroutine act like
it has high priority. The only other situation where GC wakes user
goroutines is waking all blocked assists at the end, but this uses the
global run queue and hence doesn't have this problem.

Fixes #15706.

Change-Id: I1589dee4b7b7d0c9c8575ed3472226084dfce8bc
Reviewed-on: https://go-review.googlesource.com/23172
Reviewed-by: Rick Hudson <rlh@golang.org>
2016-05-19 18:18:13 +00:00
Austin Clements
91740582c3 runtime: add 'next' flag to ready
Currently ready always puts the readied goroutine in runnext. We're
going to have to change this for some uses, so add a flag for whether
or not to use runnext.

For now we always pass true so this is a no-op change.

For #15706.

Change-Id: Iaa66d8355ccfe4bbe347570cc1b1878c70fa25df
Reviewed-on: https://go-review.googlesource.com/23171
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2016-05-19 18:17:58 +00:00
Ian Lance Taylor
79ba1e44c7 cmd/cgo: mark stub functions as no_sanitize_thread
When the generated stub functions write back the results to the stack,
they can in some cases be writing to the same memory on the g0 stack.
There is no race here (assuming there is no race in the Go code), but
the thread sanitizer does not know that.  Turn off the thread sanitizer
for the stub functions to prevent false positive warnings.

Current clang suggests the no_sanitize("thread") attribute, but that
does not work with clang 3.6 or GCC.  clang 3.6, GCC, and current clang
all support the no_sanitize_thread attribute, so use that
unconditionally.

The test case and first version of the patch are from Dmitriy Vyukov.

Change-Id: I80ce92824c6c8cf88ea0fe44f21cf50cf62474c9
Reviewed-on: https://go-review.googlesource.com/23252
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-19 17:29:13 +00:00
Joel Sing
0dcd330bc8 runtime/cgo: make cgo work with openbsd ABI changes
OpenBSD 6.0 (due out November 2016) will support PT_TLS, which will
allow for the OpenBSD cgo pthread_create() workaround to be removed.

However, in order for Go to continue working on supported OpenBSD
releases (the current release and the previous release - 5.9 and 6.0,
once 6.0 is released), we cannot enable PT_TLS immediately. Instead,
adjust the existing code so that it works with the previous TCB
allocation and the new TIB allocation. This allows the same Go
runtime to work on 5.8, 5.9 and later 6.0.

Once OpenBSD 5.9 is no longer supported (May 2017, when 6.1 is
released), PT_TLS can be enabled and the additional cgo runtime
code removed.

Change-Id: I3eed5ec593d80eea78c6656cb12557004b2c0c9a
Reviewed-on: https://go-review.googlesource.com/23197
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-19 15:43:37 +00:00
Keith Randall
d603c27c6b cmd/compile: large ptr literals must escape
They get rewritten to NEWs, and they must be marked as escaping
so walk doesn't try to allocate them back onto the stack.

Fixes #15733

Change-Id: I433033e737c3de51a9e83a5a273168dbc9110b74
Reviewed-on: https://go-review.googlesource.com/23223
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2016-05-19 15:12:01 +00:00
Mikio Hara
1ab9428eec net: deflake TestDialerDualStack
Fixes #15316.
Fixes #15574.

Change-Id: I3ec8bffd35b9e5123de4be983a53fc0b8c2a0895
Reviewed-on: https://go-review.googlesource.com/23242
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-19 14:47:33 +00:00
Mikio Hara
086d7b0e9e net: deflake TestDialerDualStackFDLeak
Fixes #14717.
Updates #15157.

Change-Id: I7238b4fe39f3670c2dfe09b3a3df51a982f261ed
Reviewed-on: https://go-review.googlesource.com/23244
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-19 14:31:49 +00:00
Ian Lance Taylor
1f7a0d4b5e runtime: don't do a plain throw when throwsplit == true
The test case in #15639 somehow causes an invalid syscall frame. The
failure is obscured because the throw occurs when throwsplit == true,
which causes a "stack split at bad time" error when trying to print the
throw message.

This CL fixes the "stack split at bad time" by using systemstack. No
test because there shouldn't be any way to trigger this error anyhow.

Update #15639.

Change-Id: I4240f3fd01bdc3c112f3ffd1316b68504222d9e1
Reviewed-on: https://go-review.googlesource.com/23153
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2016-05-19 04:37:45 +00:00
Scott Bell
2a12035f8e expvar: slightly expand documentation for Var's String method
Fixes #15088.

Change-Id: I7727829a4062e15c0e5e3beff4d0bfc1fa327b0f
Reviewed-on: https://go-review.googlesource.com/23232
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-19 04:20:47 +00:00
Brad Fitzpatrick
255e206b2b net/http: update bundled http2
Updates x/net/http2 to git rev 5916dcb1 for:

* http2, lex/httplex: make Transport reject bogus headers before sending
  https://golang.org/cl/23229

* http2: reject more trailer values
  https://golang.org/cl/23230

Fixes #14048
Fixes #14188

Change-Id: Iaa8beca6e005267a3e849a10013eb424a882f2bb
Reviewed-on: https://go-review.googlesource.com/23234
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-19 03:51:11 +00:00
Mikio Hara
8d428ed218 net: don't return io.EOF from zero byte reads on Plan 9
Updates #15735.
Fixes #15741.

Change-Id: Ic4ad7e948e8c3ab5feffef89d7a37417f82722a1
Reviewed-on: https://go-review.googlesource.com/23199
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-19 03:50:54 +00:00