net/http: ensured that proxy errors are returned by Transport.RoundTrip.

Fixes issue 8755.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews, jtuley
https://codereview.appspot.com/136710044

Committer: Brad Fitzpatrick <bradfitz@golang.org>
cmd/go, testing: add TestMain support

Fixes issue 8202.

LGTM=r, bradfitz
R=r, josharian, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/148770043
runtime: add runtime? prefix to some static variables

Pure renaming. This will make an upcoming CL have smaller diffs.

LGTM=dvyukov, iant
R=iant, dvyukov
CC=golang-codereviews
https://codereview.appspot.com/142280043
net/http: document server recovering panics

Fixes issue 8594.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://codereview.appspot.com/145760043
cmd/go: fix typo

LGTM=rsc
R=rsc
CC=golang-codereviews
https://codereview.appspot.com/138700043
spec: clarify panic behavior when deferring nil functions

Fixes issue 8107.

LGTM=iant, rsc, r
R=r, rsc, iant, ken
CC=golang-codereviews
https://codereview.appspot.com/145960043
spec: add dropped comma
The proposed text in the last CL had a comma that was missing from the submitted spec.

LGTM=gri
R=gri
CC=golang-codereviews
https://codereview.appspot.com/150720043
runtime: Fix interaction between Goexit and defers

When running defers, we must check whether the defer
has already been marked as started so we don't run it twice.

Fixes issue 8774.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://codereview.appspot.com/142280044
runtime: be very careful with bad pointer tests

Saw this on a test:

runtime: bad pointer in frame runtime_test.testSetPanicOnFault at 0xc20801c6b0: 0xfff
fatal error: bad pointer!

runtime stack:
...
copystack(0xc2081bf7a0, 0x1000)
        /root/work/solaris-amd64-smartos-2dde8b453d26/go/src/runtime/stack.c:621 +0x173 fp=0xfffffd7ffd5ffee0 sp=0xfffffd7ffd5ffe20
runtime.newstack()
        /root/work/solaris-amd64-smartos-2dde8b453d26/go/src/runtime/stack.c:774 +0x552 fp=0xfffffd7ffd5fff90 sp=0xfffffd7ffd5ffee0
runtime.morestack()
        /root/work/solaris-amd64-smartos-2dde8b453d26/go/src/runtime/asm_amd64.s:324 +0x90 fp=0xfffffd7ffd5fff98 sp=0xfffffd7ffd5fff90

goroutine 163354 [stack growth]:
...
runtime.convT2E(0x587000, 0xc20807bea8, 0x0, 0x0)
        /root/work/solaris-amd64-smartos-2dde8b453d26/go/src/runtime/iface.go:141 +0xd2 fp=0xc20801c678 sp=0xc20801c640
runtime_test.testSetPanicOnFault(0xc20822c510, 0xfff, 0xc20801c748)
        /root/work/solaris-amd64-smartos-2dde8b453d26/go/src/runtime/runtime_test.go:211 +0xc6 fp=0xc20801c718 sp=0xc20801c678
...

This test is testing bad pointers.  It loads the bad pointer into a pointer variable,
but before it gets a chance to dereference it, calls convT2E.  That call causes a stack copy,
which exposes that live but bad pointer variable.

LGTM=dvyukov
R=golang-codereviews, dvyukov
CC=golang-codereviews
https://codereview.appspot.com/146880043
image/gif: don't let the per-frame transparent index modify the global
palette.

Fixes issue 7993.

LGTM=r
R=r
CC=golang-codereviews, james.jdunne
https://codereview.appspot.com/138600043
net/http: replace z_last_test hack with testing.Main

LGTM=adg
R=rsc, adg
CC=golang-codereviews
https://codereview.appspot.com/144240043
database/sql: Close per-tx prepared statements when the associated tx ends

LGTM=bradfitz
R=golang-codereviews, bradfitz, mattn.jp
CC=golang-codereviews
https://codereview.appspot.com/131650043

Committer: Brad Fitzpatrick <bradfitz@golang.org>
text/template: allow comparison functions to work between any integers
Previously, signed and unsigned integers could not be compared, but
this has problems with things like comparing 'x' with a byte in a string.
Since signed and unsigned integers have a well-defined ordering,
even though their types are different, and since we already allow
comparison regardless of the size of the integers, why not allow it
regardless of the sign?

Integers only, a fine place to draw the line.

Fixes issue 7489.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://codereview.appspot.com/149780043
fmt: make printing of ints 25-35% faster
Inspired by a remark by Leonard Holz, use constants for division

BenchmarkSprintfEmpty           130           132           +1.54%
BenchmarkSprintfString          438           437           -0.23%
BenchmarkSprintfInt             417           414           -0.72%
BenchmarkSprintfIntInt          663           691           +4.22%
BenchmarkSprintfPrefixedInt     791           774           -2.15%
BenchmarkSprintfFloat           701           686           -2.14%
BenchmarkManyArgs               2584          2469          -4.45%
BenchmarkFprintInt              488           357           -26.84%
BenchmarkFprintIntNoAlloc       402           265           -34.08%
BenchmarkScanInts               1244346       1267574       +1.87%
BenchmarkScanRecursiveInt       1748741       1724138       -1.41%

Update issue 3463

LGTM=josharian, rsc
R=golang-codereviews, josharian, rsc
CC=golang-codereviews
https://codereview.appspot.com/144250043
doc/go1.4.txt: text/template comparison functions allow int==uint

CC=golang-codereviews
https://codereview.appspot.com/142450043
fmt: document that self-recursive data structures can be fatal

Fixes issue 8241.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://codereview.appspot.com/144420043
text/template: type-check chained node as argument
Was just a missing case (literally) in the type checker.

Fixes issue 8473.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://codereview.appspot.com/142460043
runtime: remove unused function declaration

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/145970043
runtime: fix runtime.Breakpoint on ARMv5

Fixes issue 8775.

Use the illegal instruction suggested by Ian in https://codereview.appspot.com/144180043/#msg4 on all arm arches.

LGTM=minux
R=golang-codereviews, gobot, rsc
CC=golang-codereviews, iant, minux
https://codereview.appspot.com/146130043
os: fix another case where RemoveAll should return nil

This hopefully fixes issue 8793.

Fixes Issue 8793

LGTM=iant
R=rsc, iant
CC=golang-codereviews
https://codereview.appspot.com/150860046