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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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#13851Fixes#15744
Change-Id: I3522aace14179a1ca070fd7063368a831167a0f7
Reviewed-on: https://go-review.googlesource.com/23254
Reviewed-by: Andrew Gerrand <adg@golang.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>