crypto/tls: enforce that either ServerName or InsecureSkipVerify be given.

crypto/tls has two functions for creating a client connection: Dial,
which most users are expected to use, and Client, which is the
lower-level API.

Dial does what you expect: it gives you a secure connection to the host
that you specify and the majority of users of crypto/tls appear to work
fine with it.

Client gives more control but needs more care. Specifically, if it
wasn't given a server name in the tls.Config then it didn't check that
the server's certificates match any hostname - because it doesn't have
one to check against. It was assumed that users of the low-level API
call VerifyHostname on the certificate themselves if they didn't supply
a hostname.

A review of the uses of Client both within Google and in a couple of
external libraries has shown that nearly all of them got this wrong.

Thus, this change enforces that either a ServerName or
InsecureSkipVerify is given. This does not affect tls.Dial.

See discussion at https://groups.google.com/d/msg/golang-nuts/4vnt7NdLvVU/b1SJ4u0ikb0J.

Fixes issue 7342.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/67010043
testing: improve introduction to package comment
Fixes issue 7361.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/66910045
A+C: Patrick Mézard (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://codereview.appspot.com/64100047
os/exec: explicitly mention Cmd.Wait() has to be called eventually

LGTM=minux.ma, r
R=golang-codereviews, minux.ma, r
CC=golang-codereviews
https://codereview.appspot.com/67280043

Committer: Rob Pike <r@golang.org>
cmd/ld: don't emit unreachable dynimport symbols in ELF symtab.
Fix build for Dragonfly BSD.
Fixes issue 7318.
Fixes issue 7367.

LGTM=jsing, iant
R=jsing, iant, mikioh.mikioh
CC=golang-codereviews
https://codereview.appspot.com/64340043
cmd/gc: diagnose "make([]T, non-integer)" correctly.
Fixes issue 7223.

LGTM=rsc
R=golang-codereviews, gobot, rsc
CC=golang-codereviews
https://codereview.appspot.com/63040043
misc/cgo/testso: don't use TLS variables on Darwin and OpenBSD.
Fix build for 10.6 Darwin builders and OpenBSD builers.

LGTM=jsing
R=golang-codereviews, dave, jsing
CC=golang-codereviews
https://codereview.appspot.com/67710043
net/http: fix comment in connectMethod's key format

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

Committer: Brad Fitzpatrick <bradfitz@golang.org>
syscall: consolidate test cases for Unix-like systems

As per request from minux in CL 61520049, this CL consolidates
existing test cases for Unix-like systems into one file except
Linux-specific credential test.

LGTM=bradfitz
R=iant, minux.ma, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/67800044
syscall: make mkerrors.sh work with clang

LGTM=iant
R=golang-codereviews, minux.ma, gobot, iant
CC=golang-codereviews
https://codereview.appspot.com/67170043
syscall: add fcntl test

Also updates documentation.

LGTM=minux.ma
R=iant, bradfitz, nightlyone, minux.ma
CC=golang-codereviews
https://codereview.appspot.com/58660044
runtime/race: fix finalizer tests
After "runtime: combine small NoScan allocations" finalizers
for small objects run more non deterministically.
TestRaceFin episodically fails on my darwin/amd64.

LGTM=khr
R=golang-codereviews, khr, dave
CC=golang-codereviews
https://codereview.appspot.com/56970043
net/http: don't pile up defers in b.N loop

One defer was not removed in CL61150043.

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

Committer: Dmitriy Vyukov <dvyukov@google.com>
codereview: remove unused upload_options.revision

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

Committer: Russ Cox <rsc@golang.org>
gdb: Add partial python3 + go1.2 support to runtime-gdb.py

Update issue 6963 Fixes pretty printing maps and updates
functions for interacting with $len(). goroutine $n bt
remains not working. Tested on gdb using python 2 and 3.
Fixes issue 7052
Update issue 6963
Fixes issue 6698

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

Committer: Russ Cox <rsc@golang.org>
time: explicitely mention Tickers have to be stopped

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

Committer: Russ Cox <rsc@golang.org>
runtime: use monotonic clock for timers (linux/386, linux/amd64)

This lays the groundwork for making Go robust when the system's
calendar time jumps around. All input values to the runtimeTimer
struct now use the runtime clock as a common reference point.
This affects net.Conn.Set[Read|Write]Deadline(), time.Sleep(),
time.Timer, etc. Under normal conditions, behavior is unchanged.

Each platform and architecture's implementation of runtime·nanotime()
should be modified to use a monotonic system clock when possible.

Platforms/architectures modified and tested with monotonic clock:
  linux/x86     - clock_gettime(CLOCK_MONOTONIC)

Update issue 6007

LGTM=dvyukov, rsc
R=golang-codereviews, dvyukov, alex.brainman, stephen.gutekanst, dave, rsc, mikioh.mikioh
CC=golang-codereviews
https://codereview.appspot.com/53010043

Committer: Russ Cox <rsc@golang.org>
runtime: stack allocate Panic structure during runtime.panic

Update issue 7347

When runtime.panic is called the *Panic is malloced from the heap. This can lead to a gc cycle while panicing which can make a bad situation worse.

It appears to be possible to stack allocate the Panic and avoid malloc'ing during a panic.

Ref: https://groups.google.com/d/topic/golang-dev/OfxqpklGkh0/discussion

LGTM=minux.ma, dvyukov, rsc
R=r, minux.ma, gobot, rsc, dvyukov
CC=golang-codereviews
https://codereview.appspot.com/66830043

Committer: Russ Cox <rsc@golang.org>
runtime: fix double symbol definition
runfinqv is already defined the same way on line 271.
There may also be something to fix in compiler/linker wrt diagnostics.
Fixes issue 7375.

LGTM=bradfitz
R=golang-codereviews, dave, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/67850044
net/rpc: use RunParallel in benchmarks

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