os, syscall: add Unsetenv

Also address a TODO, making Clearenv pass through to cgo.

Based largely on Minux's earlier https://codereview.appspot.com/82040044

Fixes Issue 6423

LGTM=iant, alex.brainman, r, rsc
R=rsc, iant, r, alex.brainman
CC=golang-codereviews
https://codereview.appspot.com/148370043
net/rpc: shut down connection if gob has error
The nicest solution would be to buffer the message and only write
it if it encodes correctly, but that adds considerable memory and
CPU overhead for a very rare condition. Instead, we just shut
down the connection if this happens.
Fixes issue 7689.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://codereview.appspot.com/146670043
testing: clearer comment

Fixes issue 8797.

LGTM=r
R=r
CC=golang-codereviews
https://codereview.appspot.com/146680043
reflect: fix IsValid vs Kind mismatch after Elem of nil interface

LGTM=r
R=r
CC=golang-codereviews
https://codereview.appspot.com/151960044
fmt: fix internal unknownType function
This thing should never be called, but before
151960044 it was being called, incorrectly.
This is now just a precaution but let's pretend it
Fixes issue 8843
even though that was fixed by 151960044.
The test case was already there and ran, another mystery.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://codereview.appspot.com/151970043
doc/go_faq.html: explain the policy about unused imports a little better
This new text won't stop the whining but it might focus the whining a little more.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://codereview.appspot.com/146680044
encoding/binary: slightly better documentation

Fixes issue 7306.

LGTM=r
R=r
CC=golang-codereviews
https://codereview.appspot.com/153820044
encoding/json: don't panic on incorrect map argument

Fixes issue 8305.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://codereview.appspot.com/145680044
time: A Timer must be properly created before use (documentation).

Fixes issue 8776.

LGTM=bradfitz
R=rsc, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/145710043
run.bat: comment text properly

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/153830044
syscall: fix Setenv for plan 9

envi needs to be updated during Setenv so the key can be correctly deleted later with Unsetenv.

Update issue 8849.

LGTM=0intro
R=bradfitz, 0intro
CC=golang-codereviews
https://codereview.appspot.com/149300046

Committer: David du Colombier <0intro@gmail.com>
A+C: add Mrunal Patel (Red Hat corporate CLA)

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/152010043
syscall: support UID/GID map files for Linux user namespaces

Fixes issue 8447.

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

Committer: Ian Lance Taylor <iant@golang.org>
encoding/binary: fix error message

In the process, simplified internal sizeOf and
dataSize functions. Minor positive impact on
performance. Added test case.

benchmark                         old ns/op     new ns/op     delta
BenchmarkReadSlice1000Int32s      14006         14122         +0.83%
BenchmarkReadStruct               2508          2447          -2.43%
BenchmarkReadInts                 921           928           +0.76%
BenchmarkWriteInts                2086          2081          -0.24%
BenchmarkWriteSlice1000Int32s     13440         13497         +0.42%
BenchmarkPutUvarint32             28.5          26.3          -7.72%
BenchmarkPutUvarint64             81.3          76.7          -5.66%

benchmark                         old MB/s     new MB/s     speedup
BenchmarkReadSlice1000Int32s      285.58       283.24       0.99x
BenchmarkReadStruct               27.90        28.60        1.03x
BenchmarkReadInts                 32.57        32.31        0.99x
BenchmarkWriteInts                14.38        14.41        1.00x
BenchmarkWriteSlice1000Int32s     297.60       296.36       1.00x
BenchmarkPutUvarint32             140.55       151.92       1.08x
BenchmarkPutUvarint64             98.36        104.33       1.06x

Fixes issue 6818.

LGTM=r
R=r
CC=golang-codereviews
https://codereview.appspot.com/149290045
math/big: math.Exp should return result >= 0 for |m| > 0

The documentation states that Exp(x, y, m)
computes x**y mod |m| for m != nil && m > 0.
In math.big, Mod is the Euclidean modulus,
which is always >= 0.

Fixes issue 8822.

LGTM=agl, r, rsc
R=agl, r, rsc
CC=golang-codereviews
https://codereview.appspot.com/145650043
fmt: make the %#v verb a special flag
The %#v verb is special: it says all values below need to print as %#v.
However, for some situations the # flag has other meanings and this
causes some issues, particularly in how Formatters work. Since %#v
dominates all formatting, translate it into actual state of the formatter
and decouple it from the # flag itself within the calculations (although
it must be restored when methods are doing the work.)
The result is cleaner code and correct handling of # for Formatters.
TODO: Apply the same thinking to the + flag in a followup CL.

Also, the wasString return value in handleMethods is always false,
so eliminate it.

Update issue 8835

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://codereview.appspot.com/146650043
undo CL 138250043 / 4eda5e4001fd

I will use different approach to solve this problem.
See CL 143160046 for details.

??? original CL description
syscall: keep Windows syscall pointers live too

Like https://codereview.appspot.com/139360044

LGTM=rsc, alex.brainman
R=alex.brainman, rsc
CC=golang-codereviews
https://codereview.appspot.com/138250043
???

LGTM=r
R=golang-codereviews, bradfitz, r
CC=golang-codereviews
https://codereview.appspot.com/147440043
cmd/cc, runtime: disallow structs without tags

Structs without tags have no unique name to use in the
Go definitions generated from the C types.
This caused issue 8812, fixed by CL 149260043.
Avoid future problems by requiring struct tags.

Update runtime as needed.
(There is no other C code in the tree.)

LGTM=bradfitz, iant
R=golang-codereviews, bradfitz, dave, iant
CC=golang-codereviews, khr, r
https://codereview.appspot.com/150360043
runtime: clear stale values from G.param and SudoG.elem

This change was necessary on the dev.garbage branch
to keep the garbage collector from seeing pointers into
invalid heap areas.

On this default (Go 1.4) branch, the change removes
some possibility for memory leaks.

LGTM=khr
R=golang-codereviews, khr
CC=golang-codereviews, iant, r, rlh
https://codereview.appspot.com/155760043
runtime: clear sg.selectdone before saving in SudoG cache

Removes another dangling pointer that might
cause a memory leak in 1.4 or crash the GC in 1.5.

LGTM=rlh
R=golang-codereviews
CC=golang-codereviews, iant, khr, r, rlh
https://codereview.appspot.com/150520043