]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agoruntime: ignore windows exception if not in Go binary
Alex Brainman [Fri, 28 Mar 2014 06:35:00 +0000 (17:35 +1100)]
runtime: ignore windows exception if not in Go binary

LGTM=minux.ma
R=golang-codereviews, minux.ma
CC=golang-codereviews
https://golang.org/cl/80400043

11 years agonet: make IPv6 capability test more suitable for address family selection on the...
Mikio Hara [Fri, 28 Mar 2014 04:27:51 +0000 (13:27 +0900)]
net: make IPv6 capability test more suitable for address family selection on the dual IP stack node

For now we strictly use IPV6_V6ONLY=1 for IPv6-only communications
and IPV6_V6ONLY=0 for both IPv4 and IPv6 communications. So let the
capability test do the same.

LGTM=iant
R=golang-codereviews, gobot, iant
CC=golang-codereviews
https://golang.org/cl/80140044

11 years agosyscall: don't generate RTF_BITS constant on OS X Mavericks and beyond
Mikio Hara [Fri, 28 Mar 2014 04:27:14 +0000 (13:27 +0900)]
syscall: don't generate RTF_BITS constant on OS X Mavericks and beyond

LGTM=iant
R=iant, bradfitz
CC=golang-codereviews
https://golang.org/cl/80700044

11 years agodoc/go1.3.html: contiguous stacks
Rob Pike [Fri, 28 Mar 2014 01:55:37 +0000 (12:55 +1100)]
doc/go1.3.html: contiguous stacks

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/81650043

11 years agoruntime: do not crash when GetQueuedCompletionStatusEx is missing
Alex Brainman [Fri, 28 Mar 2014 01:37:14 +0000 (12:37 +1100)]
runtime: do not crash when GetQueuedCompletionStatusEx is missing

Fixes #7635

LGTM=minux.ma
R=golang-codereviews, minux.ma
CC=golang-codereviews
https://golang.org/cl/80390043

11 years agocrypto/x509: update tests because Windows removed the Verisign root.
Adam Langley [Thu, 27 Mar 2014 21:56:02 +0000 (17:56 -0400)]
crypto/x509: update tests because Windows removed the Verisign root.

The root update on 3/11/2014 removed the Verisign root cert that the Go
tests use. This only affects the 'TestSystemVerify' test in
crypto/x509.

Fixes #7523.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/80000044

11 years agomisc/emacs: do not highlight built-in function if not followed by '('
Rui Ueyama [Thu, 27 Mar 2014 21:35:07 +0000 (17:35 -0400)]
misc/emacs: do not highlight built-in function if not followed by '('

Name of built-in function is not reserved word in Go, and you can
use it as variable name. "new" is often used as local variable, for
instance.

This patch is to apply font-lock-builtin-face only when built-in
function name is followed by '(', so that it doesn't highlight
non-function variable that happen to have the same name as built-in
function.

LGTM=dominik.honnef
R=golang-codereviews, dominik.honnef, adonovan
CC=golang-codereviews
https://golang.org/cl/79260043

11 years agocmd/cgo: enforce typing of 0-sized types
Daniel Morsing [Thu, 27 Mar 2014 20:23:16 +0000 (20:23 +0000)]
cmd/cgo: enforce typing of 0-sized types

cgo represents all 0-sized and unsized types internally as [0]byte. This means that pointers to incomplete types would be interchangable, even if given a name by typedef.

Fixes #7409.

LGTM=iant
R=golang-codereviews, bradfitz, iant
CC=golang-codereviews
https://golang.org/cl/76450043

11 years agomisc/emacs: handle backslash in raw string in Emacs 23
Rui Ueyama [Thu, 27 Mar 2014 19:22:52 +0000 (15:22 -0400)]
misc/emacs: handle backslash in raw string in Emacs 23

Go-mode in Emacs 23 does not recognize a backslash followed
by a backquote as end of raw string literal, as it does not
support syntax-propertize-function which Go-mode uses to
remove special meaning from backslashes in ``.

This patch provides a fallback mechanism to do the same thing
using font-lock-syntactic-keywords, which is supported by
Emacs 23.

LGTM=dominik.honnef
R=golang-codereviews, dominik.honnef
CC=adonovan, golang-codereviews
https://golang.org/cl/78730048

11 years agoruntime: enable 'bad pointer' check during garbage collection of Go stack frames
Russ Cox [Thu, 27 Mar 2014 18:06:15 +0000 (14:06 -0400)]
runtime: enable 'bad pointer' check during garbage collection of Go stack frames

This is the same check we use during stack copying.
The check cannot be applied to C stack frames, even
though we do emit pointer bitmaps for the arguments,
because (1) the pointer bitmaps assume all arguments
are always live, not true of outputs during the prologue,
and (2) the pointer bitmaps encode interface values as
pointer pairs, not true of interfaces holding integers.

For the rest of the frames, however, we should hold ourselves
to the rule that a pointer marked live really is initialized.
The interface scanning already implicitly checks this
because it interprets the type word  as a valid type pointer.

This may slow things down a little because of the extra loads.
Or it may speed things up because we don't bother enqueuing
nil pointers anymore. Enough of the rest of the system is slow
right now that we can't measure it meaningfully.
Enable for now, even if it is slow, to shake out bugs in the
liveness bitmaps, and then decide whether to turn it off
for the Go 1.3 release (issue 7650 reminds us to do this).

The new m->traceback field lets us force printing of fp=
values on all goroutine stack traces when we detect a
bad pointer. This makes it easier to understand exactly
where in the frame the bad pointer is, so that we can trace
it back to a specific variable and determine what is wrong.

Update #7650

LGTM=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/80860044

11 years agocmd/gc: liveness-related bug fixes
Russ Cox [Thu, 27 Mar 2014 18:05:57 +0000 (14:05 -0400)]
cmd/gc: liveness-related bug fixes

1. On entry to a function, only zero the ambiguously live stack variables.
Before, we were zeroing all stack variables containing pointers.
The zeroing is pretty inefficient right now (issue 7624), but there are also
too many stack variables detected as ambiguously live (issue 7345),
and that must be addressed before deciding how to improve the zeroing code.
(Changes in 5g/ggen.c, 6g/ggen.c, 8g/ggen.c, gc/pgen.c)

Fixes #7647.

2. Make the regopt word-based liveness analysis preserve the
whole-variable liveness property expected by the garbage collection
bitmap liveness analysis. That is, if the regopt liveness decides that
one word in a struct needs to be preserved, make sure it preserves
the entire struct. This is particularly important for multiword values
such as strings, slices, and interfaces, in which all the words need
to be present in order to understand the meaning.
(Changes in 5g/reg.c, 6g/reg.c, 8g/reg.c.)

Fixes #7591.

3. Make the regopt word-based liveness analysis treat a variable
as having its address taken - which makes it preserved across
all future calls - whenever n->addrtaken is set, for consistency
with the gc bitmap liveness analysis, even if there is no machine
instruction actually taking the address. In this case n->addrtaken
is incorrect (a nicer way to put it is overconservative), and ideally
there would be no such cases, but they can happen and the two
analyses need to agree.
(Changes in 5g/reg.c, 6g/reg.c, 8g/reg.c; test in bug484.go.)

Fixes crashes found by turning off "zero everything" in step 1.

4. Remove spurious VARDEF annotations. As the comment in
gc/pgen.c explains, the VARDEF must immediately precede
the initialization. It cannot be too early, and it cannot be too late.
In particular, if a function call sits between the VARDEF and the
actual machine instructions doing the initialization, the variable
will be treated as live during that function call even though it is
uninitialized, leading to problems.
(Changes in gc/gen.c; test in live.go.)

Fixes crashes found by turning off "zero everything" in step 1.

5. Do not treat loading the address of a wide value as a signal
that the value must be initialized. Instead depend on the existence
of a VARDEF or the first actual read/write of a word in the value.
If the load is in order to pass the address to a function that does
the actual initialization, treating the load as an implicit VARDEF
causes the same problems as described in step 4.
The alternative is to arrange to zero every such value before
passing it to the real initialization function, but this is a much
easier and more efficient change.
(Changes in gc/plive.c.)

Fixes crashes found by turning off "zero everything" in step 1.

6. Treat wide input parameters with their address taken as
initialized on entry to the function. Otherwise they look
"ambiguously live" and we will try to emit code to zero them.
(Changes in gc/plive.c.)

Fixes crashes found by turning off "zero everything" in step 1.

7. An array of length 0 has no pointers, even if the element type does.
Without this change, the zeroing code complains when asked to
clear a 0-length array.
(Changes in gc/reflect.c.)

LGTM=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/80160044

11 years agocmd/dist: zero output variables on entry to goc2c functions
Russ Cox [Thu, 27 Mar 2014 18:05:31 +0000 (14:05 -0400)]
cmd/dist: zero output variables on entry to goc2c functions

Zeroing the outputs makes sure that during function calls
in those functions we do not let the garbage collector
treat uninitialized values as pointers.

The garbage collector may still see uninitialized values
if a preemption occurs during the function prologue,
before the zeroing has had a chance to run.

This reduces the number of 'bad pointer' messages when
that runtime check is enabled, but it doesn't fix all of them,
so the check is still disabled.

It will also avoid leaks, although I doubt any of these were
particularly serious.

LGTM=iant, khr
R=iant, khr
CC=golang-codereviews
https://golang.org/cl/80850044

11 years agoregexp/syntax: remove InstLast
Russ Cox [Thu, 27 Mar 2014 18:05:14 +0000 (14:05 -0400)]
regexp/syntax: remove InstLast

This was added by the one-pass CL (post Go 1.2)
so it can still be removed.

Removing because surely there will be new operations
added later, and we can't change the constant value
once we define it, so "last" is a bad concept to expose.

Nothing uses it.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/81160043

11 years agocmd/gc: fix spurious 'use of untyped nil' error
Jan Ziak [Thu, 27 Mar 2014 17:47:00 +0000 (18:47 +0100)]
cmd/gc: fix spurious 'use of untyped nil' error

Fixes #6402

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/81340044

11 years agomisc/bash, misc/zsh: fix completion rules
Rui Ueyama [Thu, 27 Mar 2014 04:29:55 +0000 (00:29 -0400)]
misc/bash, misc/zsh: fix completion rules

This patch includes fixes pointed out in CL 52140043, which was
originally written by john.gosset.

LGTM=minux.ma
R=golang-codereviews, minux.ma
CC=golang-codereviews
https://golang.org/cl/80320043

11 years agoruntime: initialize complete Hiter during mapiterinit
Russ Cox [Thu, 27 Mar 2014 01:52:29 +0000 (21:52 -0400)]
runtime: initialize complete Hiter during mapiterinit

The garbage collector will scan these pointers,
so make sure they are initialized.

LGTM=bradfitz, khr
R=khr, bradfitz
CC=golang-codereviews
https://golang.org/cl/80960047

11 years agodoc/go1.3.html: explain the change to the memory model
Rob Pike [Thu, 27 Mar 2014 00:45:51 +0000 (11:45 +1100)]
doc/go1.3.html: explain the change to the memory model

LGTM=iant, rsc
R=rsc, iant, mtj
CC=golang-codereviews
https://golang.org/cl/80260044

11 years agocmd/go: Use exported CgoLDFlags when compiler=gccgo
Erik Westrup [Wed, 26 Mar 2014 22:23:31 +0000 (15:23 -0700)]
cmd/go: Use exported CgoLDFlags when compiler=gccgo

If you compile a program that has cgo LDFLAGS directives, those are exported to an environment variable to be used by subsequent compiler tool invocations. The linking phase when using the gccgo toolchain did not consider the envvar CGO_LDFLAGS's linking directives resulting in undefined references when using cgo+gccgo.

Fixes #7573

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/80780043

11 years agoA+C: Erik Westrup (individual CLA)
Ian Lance Taylor [Wed, 26 Mar 2014 22:23:05 +0000 (15:23 -0700)]
A+C: Erik Westrup (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/80920048

11 years agocmd/dist: set -Wuninitialized only when -O is also set.
Shenghou Ma [Wed, 26 Mar 2014 18:20:18 +0000 (14:20 -0400)]
cmd/dist: set -Wuninitialized only when -O is also set.
GCC on OS X 10.6 doesn't support -Wuninitialized without -O.
Fixes #7492.

LGTM=iant
R=golang-codereviews, dave, iant
CC=golang-codereviews
https://golang.org/cl/72360045

11 years agoruntime: eliminate false retention due to m->moreargp/morebuf
Dmitriy Vyukov [Wed, 26 Mar 2014 15:06:15 +0000 (19:06 +0400)]
runtime: eliminate false retention due to m->moreargp/morebuf
m->moreargp/morebuf were not cleared in case of preemption and stack growing,
it can lead to persistent leaks of large memory blocks.

It seems to fix the sync.Pool finalizer failures. I've run the test 500'000 times
w/o a single failure; previously it would fail dozens of times.

Fixes #7633.
Fixes #7533.

LGTM=rsc
R=golang-codereviews
CC=golang-codereviews, khr, rsc
https://golang.org/cl/80480044

11 years agoruntime: support channel-based mutex in race detector
Dmitriy Vyukov [Wed, 26 Mar 2014 15:05:48 +0000 (19:05 +0400)]
runtime: support channel-based mutex in race detector
Update channel race annotations to support change in
cl/75130045: doc: allow buffered channel as semaphore without initialization
The new annotations are added only for channels with capacity 1.
Strictly saying it's possible to construct a counter-example that
will produce a false positive with capacity > 1. But it's hardly can
lead to false positives in real programs, at least I would like to see such programs first.
Any additional annotations also increase probability of false negatives,
so I would prefer to add them lazily.

LGTM=rsc
R=golang-codereviews
CC=golang-codereviews, iant, khr, rsc
https://golang.org/cl/76970043

11 years agoruntime: fix yet another race in bgsweep
Dmitriy Vyukov [Wed, 26 Mar 2014 11:11:36 +0000 (15:11 +0400)]
runtime: fix yet another race in bgsweep
Currently it's possible that bgsweep finishes before all spans
have been swept (we only know that sweeping of all spans has *started*).
In such case bgsweep may fail wake up runfinq goroutine when it needs to.
finq may still be nil at this point, but some finalizers may be queued later.
Make bgsweep to wait for sweeping to *complete*, then it can decide
whether it needs to wake up runfinq for sure.
Update #7533

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/75960043

11 years agoruntime: minor improvement of string scanning
Dmitriy Vyukov [Wed, 26 Mar 2014 11:03:58 +0000 (15:03 +0400)]
runtime: minor improvement of string scanning
If we set obj, then it will be enqueued for marking at the end of the scanning loop.
This is not necessary, since we've already marked it.
This can wait for 1.4 if you wish.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/80030043

11 years agocmd/go: fix typo in help doc
Rob Pike [Wed, 26 Mar 2014 06:18:59 +0000 (17:18 +1100)]
cmd/go: fix typo in help doc
Fixes #7519.

LGTM=adg, mikioh.mikioh
R=golang-codereviews, adg, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/80370043

11 years agofmt: document order of application of %T, %p and the special interfaces
Rob Pike [Wed, 26 Mar 2014 06:18:24 +0000 (17:18 +1100)]
fmt: document order of application of %T, %p and the special interfaces
Their priority was not documented.

Fixes #7571.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/80360043

11 years agodoc: document DragonFly BSD port
Mikio Hara [Wed, 26 Mar 2014 05:06:18 +0000 (14:06 +0900)]
doc: document DragonFly BSD port

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/80120044

11 years agocmd/go: ensure external test files are presented to the linker first
Dave Cheney [Wed, 26 Mar 2014 04:30:55 +0000 (15:30 +1100)]
cmd/go: ensure external test files are presented to the linker first

Fixes #7627.

CL 61970044 changed the order in which .a files are passed to gccgo's link phase. However by reversing the order it caused gccgo to complain if both internal (liba.a) and external (liba_test.a) versions of a package were presented as the former would not contain all the necessary symbols, and the latter would duplicate symbols already defined.

This change ensures that all 'fake' targets remain at the top of the final link order which should be fine as a package compiled as an external test is a superset of its internal sibling.

Looking at how gcToolchain links tests I think this change now accurately mirrors those actions which present $WORK/_test before $WORK in the link order.

LGTM=iant
R=rsc, iant
CC=golang-codereviews, michael.hudson
https://golang.org/cl/80300043

11 years agocmd/gc: add missing entries to lexn and yytfix.
Shenghou Ma [Wed, 26 Mar 2014 03:21:57 +0000 (23:21 -0400)]
cmd/gc: add missing entries to lexn and yytfix.
Makes gc -x better.

LGTM=r
R=golang-codereviews, bradfitz, r
CC=golang-codereviews
https://golang.org/cl/73090043

11 years agodoc: document Solaris port.
Shenghou Ma [Wed, 26 Mar 2014 03:21:28 +0000 (23:21 -0400)]
doc: document Solaris port.

LGTM=aram, rsc
R=aram, adg, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/74750045

11 years agodoc/go1.3.html: new release document outline
Rob Pike [Wed, 26 Mar 2014 02:56:16 +0000 (13:56 +1100)]
doc/go1.3.html: new release document outline
Almost all TODOS, but the structure is there and it has the details
from go1.3.txt, which is hereby deleted.

LGTM=dominik.honnef, adg
R=golang-codereviews, dominik.honnef, adg
CC=golang-codereviews
https://golang.org/cl/80240044

11 years agomisc/vim: Disable automatic line wrapping by textwidth.
David Barnett [Wed, 26 Mar 2014 02:51:16 +0000 (13:51 +1100)]
misc/vim: Disable automatic line wrapping by textwidth.

If someone configures a 'textwidth' in go files, vim will by default insert
newlines into long lines as you type, which breaks syntax and doesn't really
make sense for go code. This fixes the default.

LGTM=dsymonds
R=golang-codereviews, gobot, dsymonds
CC=golang-codereviews
https://golang.org/cl/76890046

11 years agoC: add David Barnett (Google CLA).
David Symonds [Wed, 26 Mar 2014 02:51:00 +0000 (13:51 +1100)]
C: add David Barnett (Google CLA).

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/80310043

11 years agonet: deflake TestTCPConcurrentAccept
Mikio Hara [Mon, 24 Mar 2014 17:56:37 +0000 (02:56 +0900)]
net: deflake TestTCPConcurrentAccept

Some platform that implements inp_localgroup-like shared internet
protocol control block group looks a bit sensitive about transport
layer protocol's address:port reuse. Sometimes it rejects a TCP SYN
packet using TCP RST, and sometimes silence.

For now, until test case refactoring, we admit few Dial failures on
TestTCPConcurrentAccept as a workaround.

Update #7400
Update #7541

LGTM=jsing
R=jsing
CC=golang-codereviews
https://golang.org/cl/75920043

11 years agonet: avoid multiple calling of syscall connect on Unix variants
Mikio Hara [Mon, 24 Mar 2014 17:56:10 +0000 (02:56 +0900)]
net: avoid multiple calling of syscall connect on Unix variants

The previous fix CL 69340044 still leaves a possibility of it.
This CL prevents the kernel, especially DragonFly BSD, from
performing unpredictable asynchronous connection establishment
on stream-based transport layer protocol sockets.

Update #7541
Update #7474

LGTM=jsing
R=jsing
CC=golang-codereviews
https://golang.org/cl/75930043

11 years agoruntime: slience warning on 32-bit platforms
Mikio Hara [Wed, 26 Mar 2014 01:21:22 +0000 (10:21 +0900)]
runtime: slience warning on 32-bit platforms

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/80250043

11 years agodoc/gopher: fix typo in README
Andrew Gerrand [Wed, 26 Mar 2014 00:23:33 +0000 (11:23 +1100)]
doc/gopher: fix typo in README

LGTM=josharian
R=golang-codereviews, josharian
CC=golang-codereviews
https://golang.org/cl/80220043

11 years agoruntime: use VEH for windows/amd64 exception handling
Alex Brainman [Wed, 26 Mar 2014 00:13:50 +0000 (11:13 +1100)]
runtime: use VEH for windows/amd64 exception handling

Fixes windows/amd64 build.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/79470046

11 years agodoc/gopher: add README
Andrew Gerrand [Tue, 25 Mar 2014 23:24:57 +0000 (10:24 +1100)]
doc/gopher: add README

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/79890046

11 years agonet/http: disable recently-introduced flaky test on Windows
Brad Fitzpatrick [Tue, 25 Mar 2014 22:19:58 +0000 (15:19 -0700)]
net/http: disable recently-introduced flaky test on Windows

Disable it until it's debugged so it doesn't hide other real
problems on Windows. The test was known to be unreliable
anyway (which is why it only needed 1 of 20 runs to pass), but
apparently it never passes on Windows. Figure out why later.

Update #7634

LGTM=alex.brainman
R=adg, alex.brainman
CC=golang-codereviews
https://golang.org/cl/80110043

11 years agoruntime: WriteHeapDump dumps the heap to a file.
Keith Randall [Tue, 25 Mar 2014 22:09:49 +0000 (15:09 -0700)]
runtime: WriteHeapDump dumps the heap to a file.

See http://golang.org/s/go13heapdump for the file format.

LGTM=rsc
R=rsc, bradfitz, dvyukov, khr
CC=golang-codereviews
https://golang.org/cl/37540043

11 years agoruntime: fix windows build (buggy commit in 19543:d68b79ccbfed)
Ian Lance Taylor [Tue, 25 Mar 2014 21:17:00 +0000 (14:17 -0700)]
runtime: fix windows build (buggy commit in 19543:d68b79ccbfed)

TBR=rsc
CC=golang-codereviews
https://golang.org/cl/80090043

11 years agoruntime: redo stack map entries to avoid false retention
Keith Randall [Tue, 25 Mar 2014 21:11:34 +0000 (14:11 -0700)]
runtime: redo stack map entries to avoid false retention

Change two-bit stack map entries to encode:
0 = dead
1 = scalar
2 = pointer
3 = multiword

If multiword, the two-bit entry for the following word encodes:
0 = string
1 = slice
2 = iface
3 = eface

That way, during stack scanning we can check if a string
is zero length or a slice has zero capacity.  We can avoid
following the contained pointer in those cases.  It is safe
to do so because it can never be dereferenced, and it is
desirable to do so because it may cause false retention
of the following block in memory.

Slice feature turned off until issue 7564 is fixed.

Update #7549

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/76380043

11 years agoruntime: accurately record whether heap memory is reserved
Ian Lance Taylor [Tue, 25 Mar 2014 20:22:19 +0000 (13:22 -0700)]
runtime: accurately record whether heap memory is reserved

The existing code did not have a clear notion of whether
memory has been actually reserved.  It checked based on
whether in 32-bit mode or 64-bit mode and (on GNU/Linux) the
requested address, but it confused the requested address and
the returned address.

LGTM=rsc
R=rsc, dvyukov
CC=golang-codereviews, michael.hudson
https://golang.org/cl/79610043

11 years agonet/http: don't re-use Transport connections if we've seen an EOF
Brad Fitzpatrick [Tue, 25 Mar 2014 17:59:09 +0000 (10:59 -0700)]
net/http: don't re-use Transport connections if we've seen an EOF

This the second part of making persistent HTTPS connections to
certain servers (notably Amazon) robust.

See the story in part 1: https://golang.org/cl/76400046/

This is the http Transport change that notes whether our
net.Conn.Read has ever seen an EOF. If it has, then we use
that as an additional signal to not re-use that connection (in
addition to the HTTP response headers)

Fixes #3514

LGTM=rsc
R=agl, rsc
CC=golang-codereviews
https://golang.org/cl/79240044

11 years agocrypto/tls: make Conn.Read return (n, io.EOF) when EOF is next in buffer
Brad Fitzpatrick [Tue, 25 Mar 2014 17:58:35 +0000 (10:58 -0700)]
crypto/tls: make Conn.Read return (n, io.EOF) when EOF is next in buffer

Update #3514

An io.Reader is permitted to return either (n, nil)
or (n, io.EOF) on EOF or other error.

The tls package previously always returned (n, nil) for a read
of size n if n bytes were available, not surfacing errors at
the same time.

Amazon's HTTPS frontends like to hang up on clients without
sending the appropriate HTTP headers. (In their defense,
they're allowed to hang up any time, but generally a server
hangs up after a bit of inactivity, not immediately.) In any
case, the Go HTTP client tries to re-use connections by
looking at whether the response headers say to keep the
connection open, and because the connection looks okay, under
heavy load it's possible we'll reuse it immediately, writing
the next request, just as the Transport's always-reading
goroutine returns from tls.Conn.Read and sees (0, io.EOF).

But because Amazon does send an AlertCloseNotify record before
it hangs up on us, and the tls package does its own internal
buffering (up to 1024 bytes) of pending data, we have the
AlertCloseNotify in an unread buffer when our Conn.Read (to
the HTTP Transport code) reads its final bit of data in the
HTTP response body.

This change makes that final Read return (n, io.EOF) when
an AlertCloseNotify record is buffered right after, if we'd
otherwise return (n, nil).

A dependent change in the HTTP code then notes whether a
client connection has seen an io.EOF and uses that as an
additional signal to not reuse a HTTPS connection. With both
changes, the majority of Amazon request failures go
away. Without either one, 10-20 goroutines hitting the S3 API
leads to such an error rate that empirically up to 5 retries
are needed to complete an API call.

LGTM=agl, rsc
R=agl, rsc
CC=golang-codereviews
https://golang.org/cl/76400046

11 years agoruntime: change nproc local variable to uint32
Ian Lance Taylor [Tue, 25 Mar 2014 12:18:08 +0000 (05:18 -0700)]
runtime: change nproc local variable to uint32

The nproc and ndone fields are uint32.  This makes the type
consistent.

LGTM=minux.ma
R=golang-codereviews, minux.ma
CC=golang-codereviews
https://golang.org/cl/79340044

11 years agodatabase/sql: add "defer rows.Close()" to the example code.
Nigel Tao [Tue, 25 Mar 2014 02:32:18 +0000 (13:32 +1100)]
database/sql: add "defer rows.Close()" to the example code.

Strictly speaking, it's not necessary in example_test.go, as the
Rows.Close docs say that "If Next returns false, the Rows are closed
automatically". However, if the for loop breaks or returns early, it's
not obvious that you'll leak unless you explicitly call Rows.Close.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews, rsc
https://golang.org/cl/79330043

11 years agoruntime: use VEH, not SEH, for windows/386 exception handling
Russ Cox [Tue, 25 Mar 2014 01:22:16 +0000 (21:22 -0400)]
runtime: use VEH, not SEH, for windows/386 exception handling

Structured Exception Handling (SEH) was the first way to handle
exceptions (memory faults, divides by zero) on Windows.
The S might as well stand for "stack-based": the implementation
interprets stack addresses in a few different ways, and it gets
subtly confused by Go's management of stacks. It's also something
that requires active maintenance during cgo switches, and we've
had bugs in that maintenance in the past.

We have recently come to believe that SEH cannot work with
Go's stack usage. See http://golang.org/issue/7325 for details.

Vectored Exception Handling (VEH) is more like a Unix signal
handler: you set it once for the whole process and forget about it.

This CL drops all the SEH code and replaces it with VEH code.
Many special cases and 7 #ifdefs disappear.

VEH was introduced in Windows XP, so Go on windows/386 will
now require Windows XP or later. The previous requirement was
Windows 2000 or later. Windows 2000 immediately preceded
Windows XP, so Windows 2000 is the only affected version.
Microsoft stopped supporting Windows 2000 in 2010.
See http://golang.org/s/win2000-golang-nuts for details.

Fixes #7325.

LGTM=alex.brainman, r
R=golang-codereviews, alex.brainman, stephen.gutekanst, dave
CC=golang-codereviews, iant, r
https://golang.org/cl/74790043

11 years agotime: add comment explaining rejection of years outside [0000,9999]
Russ Cox [Tue, 25 Mar 2014 00:34:17 +0000 (20:34 -0400)]
time: add comment explaining rejection of years outside [0000,9999]

This has come up twice now. Redirect future questions
to the explanation in the issue tracker.

LGTM=iant, r
R=r, iant
CC=golang-codereviews
https://golang.org/cl/79550043

11 years agomath/cmplx: define Pow(0, x) for problematic values of x.
Rob Pike [Tue, 25 Mar 2014 00:25:20 +0000 (11:25 +1100)]
math/cmplx: define Pow(0, x) for problematic values of x.
Currently it's always zero, but that is inconsistent with math.Pow
and also plain wrong.
This is a proposal for how it should be defined.
Fixes #7583.

LGTM=rsc
R=golang-codereviews, iant, gobot, rsc
CC=golang-codereviews
https://golang.org/cl/76940044

11 years agoregexp/syntax: document the upper limit of n in x{n}
Rob Pike [Tue, 25 Mar 2014 00:19:25 +0000 (11:19 +1100)]
regexp/syntax: document the upper limit of n in x{n}
Fixes #7252.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/77990044

11 years agoregexp: document that it is linear in the input size.
Rob Pike [Tue, 25 Mar 2014 00:17:30 +0000 (11:17 +1100)]
regexp: document that it is linear in the input size.
Fixes #7488.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/78050043

11 years agodoc: allow buffered channel as semaphore without initialization
Russ Cox [Mon, 24 Mar 2014 23:11:21 +0000 (19:11 -0400)]
doc: allow buffered channel as semaphore without initialization

This rule not existing has been the source of many discussions
on golang-dev and on issues. We have stated publicly that it is
true, but we have never written it down. Write it down.

Fixes #6242.

LGTM=r, dan.kortschak, iant, dvyukov
R=golang-codereviews, r, dominik.honnef, dvyukov, dan.kortschak, iant, 0xjnml
CC=golang-codereviews
https://golang.org/cl/75130045

11 years agocmd/gc: fix spurious 'const initializer is not a constant' error
Jan Ziak [Mon, 24 Mar 2014 19:36:42 +0000 (20:36 +0100)]
cmd/gc: fix spurious 'const initializer is not a constant' error

Fixes #6403

LGTM=rsc
R=iant, rsc
CC=golang-codereviews
https://golang.org/cl/72840044

11 years agobufio: fix bug that ReadFrom stops before EOF or error
Rui Ueyama [Mon, 24 Mar 2014 18:48:34 +0000 (11:48 -0700)]
bufio: fix bug that ReadFrom stops before EOF or error

ReadFrom should not return until it receives a non-nil error
or too many contiguous (0, nil)s from a given reader.
Currently it immediately returns if it receives one (0, nil).
Fixes #7611.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/76400048

11 years agocmd/gc: round floats with a large negative exponent towards zero
Jan Ziak [Mon, 24 Mar 2014 17:10:29 +0000 (10:10 -0700)]
cmd/gc: round floats with a large negative exponent towards zero

Fixes #6902

LGTM=iant
R=iant, rsc
CC=golang-codereviews
https://golang.org/cl/78730049

11 years agostrings: minor cleanup
Rui Ueyama [Mon, 24 Mar 2014 01:58:35 +0000 (18:58 -0700)]
strings: minor cleanup

bi is a slice and not an array, so bi[:] does not make much sense.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/79280043

11 years agomisc/nacl: add Native Client support scripts and documentation
Dave Cheney [Mon, 24 Mar 2014 01:34:09 +0000 (12:34 +1100)]
misc/nacl: add Native Client support scripts and documentation

LGTM=josharian, dan.kortschak
R=golang-codereviews, josharian, dan.kortschak
CC=golang-codereviews
https://golang.org/cl/75080043

11 years agounicode/utf8: minor code simplification
Rui Ueyama [Sun, 23 Mar 2014 22:44:29 +0000 (15:44 -0700)]
unicode/utf8: minor code simplification

It's a little bit waste to check if r is not a surrogate
code point because RuneError is not a surrogate code point.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/79230043

11 years agounicode/utf16: remove unnecessary type conversions
Rui Ueyama [Sun, 23 Mar 2014 22:07:26 +0000 (15:07 -0700)]
unicode/utf16: remove unnecessary type conversions

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/79080044

11 years agobufio: fix typo in test
Rui Ueyama [Sun, 23 Mar 2014 00:40:17 +0000 (17:40 -0700)]
bufio: fix typo in test

LGTM=dave
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/79120043

11 years agoregexp: remove unused variables
Rui Ueyama [Sat, 22 Mar 2014 18:05:40 +0000 (11:05 -0700)]
regexp: remove unused variables

"min" and "max" in "case '{'" clause are fresh variables.
The variables defined in the outer scope never get value
other than 0.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/78750044

11 years agotext/scanner: handle non-io.EOF errors
Rui Ueyama [Sat, 22 Mar 2014 00:05:57 +0000 (17:05 -0700)]
text/scanner: handle non-io.EOF errors

Currently Scan ignores an error returned from source if the number
of bytes source has read is 0.

Fixes #7594.

LGTM=gri
R=golang-codereviews, bradfitz, gri
CC=golang-codereviews
https://golang.org/cl/78120043

11 years agocmd/ld: fix warnings on Plan 9
David du Colombier [Fri, 21 Mar 2014 18:26:47 +0000 (19:26 +0100)]
cmd/ld: fix warnings on Plan 9

warning: src/cmd/ld/macho.c:595 sign-extended character constant
warning: src/cmd/ld/macho.c:595 sign-extended character constant
warning: src/cmd/ld/symtab.c:63 sign-extended character constant
warning: src/cmd/ld/symtab.c:63 sign-extended character constant

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/76580046

11 years agoruntime: skip stack growth test in short mode
David du Colombier [Fri, 21 Mar 2014 17:13:23 +0000 (18:13 +0100)]
runtime: skip stack growth test in short mode

LGTM=dvyukov
R=dvyukov
CC=golang-codereviews
https://golang.org/cl/78410043

11 years agoencoding/asn1: use GeneralizedTime for times outside the range of UTCTime.
Adam Langley [Fri, 21 Mar 2014 15:14:38 +0000 (11:14 -0400)]
encoding/asn1: use GeneralizedTime for times outside the range of UTCTime.

Fixes issue #6976.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/72080044

11 years agodoc/go_faq.html: update description of stack management
Rob Pike [Fri, 21 Mar 2014 02:59:30 +0000 (13:59 +1100)]
doc/go_faq.html: update description of stack management
They aren't segmented any more, at least with gc.
Also improve the comparison of goroutines and threads.
Fixes #7373.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/77950044

11 years agodoc/effective_go.html: fix typo
Rob Pike [Thu, 20 Mar 2014 21:37:27 +0000 (08:37 +1100)]
doc/effective_go.html: fix typo
Prose referred to 'b', code used 'buf'.
Fixes #7601.

LGTM=dominik.honnef
R=golang-codereviews, dominik.honnef
CC=golang-codereviews
https://golang.org/cl/78470043

11 years agocmd/6g, cmd/8g: skip CONVNOP nodes in bgen.
Rémy Oudompheng [Thu, 20 Mar 2014 21:22:37 +0000 (22:22 +0100)]
cmd/6g, cmd/8g: skip CONVNOP nodes in bgen.

Revision 3ae4607a43ff introduced CONVNOP layers
to fix type checking issues arising from comparisons.
The added complexity made 8g run out of registers
when compiling an equality function in go.net/ipv6.

A similar issue occurred in test/sizeof.go on
amd64p32 with 6g.

Fixes #7405.

LGTM=khr
R=rsc, dave, iant, khr
CC=golang-codereviews
https://golang.org/cl/78100044

11 years agoreflect: correct alignment of call arguments on amd64p32.
Rémy Oudompheng [Thu, 20 Mar 2014 21:22:07 +0000 (22:22 +0100)]
reflect: correct alignment of call arguments on amd64p32.

Changes adapted from original CL 15680044.

LGTM=iant
R=rsc, iant, dave
CC=golang-codereviews
https://golang.org/cl/76150044

11 years agocmd/6g: make comment more consistent.
Rémy Oudompheng [Thu, 20 Mar 2014 21:21:10 +0000 (22:21 +0100)]
cmd/6g: make comment more consistent.

LGTM=dave, iant
R=iant, khr, rsc, dave
CC=golang-codereviews
https://golang.org/cl/77960044

11 years agotest: add extra test case for issue 7590
Chris Manghane [Thu, 20 Mar 2014 18:46:45 +0000 (11:46 -0700)]
test: add extra test case for issue 7590

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/78040043

11 years agocrypto/tls: clarify concurrent use of Config
Brad Fitzpatrick [Thu, 20 Mar 2014 15:32:06 +0000 (08:32 -0700)]
crypto/tls: clarify concurrent use of Config

LGTM=r, agl
R=agl, r
CC=golang-codereviews
https://golang.org/cl/77530044

11 years agotest: enable bug385_32 test on amd64p32.
Rémy Oudompheng [Thu, 20 Mar 2014 06:28:24 +0000 (07:28 +0100)]
test: enable bug385_32 test on amd64p32.

LGTM=dave
R=dave, rsc
CC=golang-codereviews
https://golang.org/cl/78110043

11 years agobase64: fix bug that decoder fails to detect corruption
Rui Ueyama [Thu, 20 Mar 2014 05:00:34 +0000 (16:00 +1100)]
base64: fix bug that decoder fails to detect corruption

Encoding.Decode() failed to detect trailing garbages if input contains "==" followed by garbage smaller than 3 bytes (for example, it failed to detect "x" in "AA==x"). This patch fixes the bug and adds a few tests.

LGTM=nigeltao
R=golang-codereviews, bradfitz, nigeltao
CC=golang-codereviews
https://golang.org/cl/75340044

11 years agobase32: remove unnecessary "if" condition
Rui Ueyama [Thu, 20 Mar 2014 04:54:17 +0000 (15:54 +1100)]
base32: remove unnecessary "if" condition

This is a patch to apply the same change as CL 76610045.

LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/77460044

11 years agocmd/6g: remove unused stosptr variable
Ian Lance Taylor [Thu, 20 Mar 2014 00:18:25 +0000 (17:18 -0700)]
cmd/6g: remove unused stosptr variable

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/78030043

11 years agocmd/6g: do small zeroings with straightline code.
Keith Randall [Wed, 19 Mar 2014 22:41:34 +0000 (15:41 -0700)]
cmd/6g: do small zeroings with straightline code.

Removes most uses of the REP prefix, which has a high startup cost.

LGTM=iant
R=golang-codereviews, iant, khr
CC=golang-codereviews
https://golang.org/cl/77920043

11 years agofmt: make %F a synonym for %f
Rob Pike [Wed, 19 Mar 2014 21:51:06 +0000 (08:51 +1100)]
fmt: make %F a synonym for %f
Rationale:
        It already is for scanning.
        It is accepted for complexes already, but doesn't work.
        It's analogous to %G and %E.
        C accepts it too, and we try to be roughly compatible.
Fixes #7518.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/77580044

11 years agostrings, bytes: ReadAt should not mutate receiver
Rui Ueyama [Wed, 19 Mar 2014 19:13:47 +0000 (12:13 -0700)]
strings, bytes: ReadAt should not mutate receiver

CL 77580046 caused a data race issue with tests that assumes ReadAt
does not mutate receiver. This patch partially revert CL 77580046
to fix it.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/77900043

11 years agounicode: minor cleanup
Rui Ueyama [Wed, 19 Mar 2014 17:14:04 +0000 (10:14 -0700)]
unicode: minor cleanup

These test cases are redundant because TestSimpleFold tests
all possible rotations of test data, so no need to add
rotated strings.

Also updated the comment as it's guaranteed that SimpleFold
returns values in increasing order.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/77730043

11 years agostrings, bytes: fix Reader.UnreadRune
Rui Ueyama [Wed, 19 Mar 2014 16:00:58 +0000 (09:00 -0700)]
strings, bytes: fix Reader.UnreadRune

UnreadRune should return an error if previous operation is not
ReadRune.

Fixes #7579.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/77580046

11 years agoruntime: add stack growth tests
Dmitriy Vyukov [Wed, 19 Mar 2014 13:22:56 +0000 (17:22 +0400)]
runtime: add stack growth tests
Also move generated code into a separate file,
because it's difficult to work with the file otherwise.

LGTM=khr
R=golang-codereviews, khr
CC=golang-codereviews
https://golang.org/cl/76080044

11 years agoruntime: fix stack split detection around fork
Dmitriy Vyukov [Wed, 19 Mar 2014 13:04:51 +0000 (17:04 +0400)]
runtime: fix stack split detection around fork
If runtime_BeforeFork splits stack, it will unsplit it
with spoiled g->stackguard. It leads to check failure in oldstack:

fatal error: stackfree: bad fixed size

runtime stack:
runtime.throw(0xadf3cd)
runtime.stackfree(0xc208040480, 0xfffffffffffff9dd, 0x1b00fa8)
runtime.oldstack()
runtime.lessstack()

goroutine 311 [stack unsplit]:
syscall.forkAndExecInChild(0xc20802eea0, 0xc208192c00, 0x5, 0x5, 0xc208072a80, ...)
syscall.forkExec(0xc20802ed80, 0x54, 0xc2081ccb40, 0x4, 0x4, ...)

Fixes #7567.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews, khr, rsc
https://golang.org/cl/77340045

11 years agocmd/gc: check exponent overflow and underflow in mparith
Jan Ziak [Wed, 19 Mar 2014 04:48:00 +0000 (05:48 +0100)]
cmd/gc: check exponent overflow and underflow in mparith

A too large float constant is an error.
A too small float constant is rounded to zero.

Fixes #7419
Update #6902

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/76730046

11 years agomisc/bash/go: remove "doc" subcommand autocompletion
Rui Ueyama [Wed, 19 Mar 2014 04:01:23 +0000 (21:01 -0700)]
misc/bash/go: remove "doc" subcommand autocompletion

"go doc" has been removed in CL 17799.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/77420045

11 years agobytes: fix panic in Map
Rui Ueyama [Wed, 19 Mar 2014 03:52:58 +0000 (20:52 -0700)]
bytes: fix panic in Map

utf8.RuneLen returns -1 for an invalid rune. In that case we
need to extend the internal buffer at least by 3 for \uFFFD.

Fixes #7577.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/77420044

11 years agostrconv: CanBackquote should reject \x7F
Rob Pike [Tue, 18 Mar 2014 23:16:48 +0000 (10:16 +1100)]
strconv: CanBackquote should reject \x7F
It's a control character.
Fixes #7565.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/77300043

11 years agocmd/go: let build -x output describe CGO_LDFLAGS env variable
Jan Ziak [Tue, 18 Mar 2014 20:47:21 +0000 (21:47 +0100)]
cmd/go: let build -x output describe CGO_LDFLAGS env variable

Fixes #7249

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/75820046

11 years agoexpvar: don't recursively acquire Map.RLock
Brad Fitzpatrick [Tue, 18 Mar 2014 18:38:39 +0000 (11:38 -0700)]
expvar: don't recursively acquire Map.RLock

Fixes #7575

LGTM=iant
R=dvyukov, iant
CC=golang-codereviews
https://golang.org/cl/77540044

11 years agonet/http: make use of testing.Errorf instead of testing.Fatalf in non-test function...
Mikio Hara [Tue, 18 Mar 2014 12:12:00 +0000 (21:12 +0900)]
net/http: make use of testing.Errorf instead of testing.Fatalf in non-test function goroutines

See testing.FailNow for further information.
Also avoid nil pointer derefernce in TestTransportMaxPerHostIdleConns.

LGTM=dave
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/76470043

11 years agobase64: refactor encoder.Write
Rui Ueyama [Tue, 18 Mar 2014 05:26:23 +0000 (16:26 +1100)]
base64: refactor encoder.Write

"nn" can never be zero for any input "p", so no check is needed.
This change should improve readability a bit.

LGTM=nigeltao
R=golang-codereviews, bradfitz, nigeltao
CC=golang-codereviews
https://golang.org/cl/76610045

11 years agocmd/go: make the default coverage mode -atomic if -race is set
Rob Pike [Tue, 18 Mar 2014 03:38:40 +0000 (14:38 +1100)]
cmd/go: make the default coverage mode -atomic if -race is set
Fixes #7013.

LGTM=adg
R=golang-codereviews, gobot, adg
CC=golang-codereviews
https://golang.org/cl/76370043

11 years agocmd/gc: fix error check for self-referential array type.
Chris Manghane [Tue, 18 Mar 2014 03:26:19 +0000 (20:26 -0700)]
cmd/gc: fix error check for self-referential array type.

LGTM=gri, iant
R=gri, iant
CC=golang-codereviews
https://golang.org/cl/75920044

11 years agoundo CL 77050045 / 073d79675aae
Brad Fitzpatrick [Tue, 18 Mar 2014 03:00:44 +0000 (20:00 -0700)]
undo CL 77050045 / 073d79675aae

Breaks all builds.

««« original CL description
cmd/gc: Add tests for self-referential array types.

LGTM=gri, iant
R=gri, iant
CC=golang-codereviews
https://golang.org/cl/77050045
»»»

TBR=cmang
R=cmang
CC=golang-codereviews
https://golang.org/cl/77210043

11 years agobuild: fix race in doc/articles/wiki test
Rick Arnold [Tue, 18 Mar 2014 02:03:03 +0000 (13:03 +1100)]
build: fix race in doc/articles/wiki test

The original test would open a local port and then immediately close it
and use the port number in subsequent tests. Between the port being closed
and reused by the later process, it could be opened by some other program
on the machine.

Changed the test to run the server process directly and have it save the
assigned port to a text file to be used by client processes.

Fixes #5564.

LGTM=adg
R=golang-codereviews, gobot, adg
CC=golang-codereviews
https://golang.org/cl/72290043

11 years agocmd/gc: Add tests for self-referential array types.
Chris Manghane [Tue, 18 Mar 2014 01:30:02 +0000 (18:30 -0700)]
cmd/gc: Add tests for self-referential array types.

LGTM=gri, iant
R=gri, iant
CC=golang-codereviews
https://golang.org/cl/77050045

11 years agofmt: document GoStringer and explain application of formats to compound objects
Rob Pike [Tue, 18 Mar 2014 00:25:04 +0000 (11:25 +1100)]
fmt: document GoStringer and explain application of formats to compound objects
%q quotes each element of a string slice; this was never explained in the docs.
Fixes #7015.

LGTM=josharian
R=golang-codereviews, josharian
CC=golang-codereviews
https://golang.org/cl/77140044

11 years agonet/http: Request Body error should not be ignored.
Luka Zakrajšek [Mon, 17 Mar 2014 22:52:52 +0000 (15:52 -0700)]
net/http: Request Body error should not be ignored.

Fixes #7521.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/76320043