crypto/tls: allow the server to enforce its ciphersuite preferences.

Previously, Go TLS servers always took the client's preferences into
account when selecting a ciphersuite. This change adds the option of
using the server's preferences, which can be expressed by setting
tls.Config.CipherSuites.

This mirrors Apache's SSLHonorCipherOrder directive.

R=golang-dev, nightlyone, bradfitz, ality
CC=golang-dev
https://codereview.appspot.com/7163043
doc/effective_go.html: add a section about the blank identifier

R=golang-dev, minux.ma, bradfitz, adg
CC=golang-dev
https://codereview.appspot.com/7134056
syscall: fix arithmetic errors in assembly for seek function for 64-bit Plan 9

Offsets for return values from seek were miscalculated
and a translation from 32-bit code for error handling
was incorrect.

R=rsc, rminnich, npe
CC=golang-dev
https://codereview.appspot.com/7181045

Committer: Russ Cox <rsc@golang.org>
A+C: Dustin Shields-Cloues (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://codereview.appspot.com/7184046
cmd/go: add hg ssh support

R=golang-dev, rsc, bradfitz
CC=golang-dev
https://codereview.appspot.com/7133048

Committer: Russ Cox <rsc@golang.org>
time: standard time doc fix and format example

This fixes the incorrect unix timestamp of the standard time and adds
an example for (Time) Format to clarify how timezones work in format strings.

Fixes issue 4364.

R=golang-dev, remyoudompheng, kevlar, rsc
CC=golang-dev
https://codereview.appspot.com/7069046

Committer: Russ Cox <rsc@golang.org>
mime, strconv: Make testdata more consistent.

All packages place testdata in a specific directory with the name
"testdata". The mime and strconv packages have been updated to use
the same convention.

mime: Move "mime/test.types" to "mime/testdata/test.types". Update test
code accordingly.

strconv: Move "strconv/testfp.txt" to "strconv/testdata/testfp.txt".
Update test code accordingly.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/7098072

Committer: Brad Fitzpatrick <bradfitz@golang.org>
cmd/go: suppress extraneous newlines in list

Before:
$ go list -f '{{range .Deps}}{{println $.Name .}}{{end}}' math time
math runtime
math unsafe

time errors
time runtime
time sync
time sync/atomic
time syscall
time unsafe

$

After:
$ go list -f '{{range .Deps}}{{println $.Name .}}{{end}}' math time
math runtime
math unsafe
time errors
time runtime
time sync
time sync/atomic
time syscall
time unsafe
$

R=minux.ma, rsc
CC=golang-dev
https://codereview.appspot.com/7130052

Committer: Russ Cox <rsc@golang.org>
encoding/xml: simplify copyValue

Delete various complications left over from an earlier reflect API.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/7124063
net: don't return nil interface address on netbsd

On NetBSD routing sockaddrs for interface address contain sockaddr_dl.

R=dave, rsc
CC=golang-dev
https://codereview.appspot.com/7085064
fmt: Remove dead code and make comments and variables consistent.

R=minux.ma, dave, rsc
CC=golang-dev
https://codereview.appspot.com/7064055

Committer: Russ Cox <rsc@golang.org>
lib9: declare __fixargv0 before use in flag.c

The Plan 9 compilers complain about not
having type information for the function,
which sets off type signature problems
during the linking stage.

R=rsc, ality, iant
CC=golang-dev
https://codereview.appspot.com/7058054

Committer: Russ Cox <rsc@golang.org>
cmd/api: fix type scrubbing

It wasn't removing names from func parameters for func types,
and it was handling "a, b string" as "string", not "string, string".

Fixes issue 4688

R=golang-dev, rsc
CC=golang-dev
https://codereview.appspot.com/7181051
encoding/json: ignore unexported fields in Unmarshal

Go 1.0 behavior was to create an UnmarshalFieldError when a json value name matched an unexported field name. This error will no longer be created and the field will be skipped instead.

Fixes issue 4660.

R=adg, rsc, bradfitz
CC=golang-dev
https://codereview.appspot.com/7139049

Committer: Russ Cox <rsc@golang.org>
testing: add Skip/Skipf

This proposal adds two methods to *testing.T, Skip(string) and Skipf(format, args...). The intent is to replace the existing log and return idiom which currently has 97 cases in the standard library. A simple example of Skip would be:

func TestSomethingLong(t *testing.T) {
        if testing.Short() {
                t.Skip("skipping test in short mode.")
                // not reached
        }
        ... time consuming work
}

Additionally tests can be skipped anywhere a *testing.T is present. An example adapted from the go.crypto/ssh/test package would be:

// setup performs some before test action and returns a func()
// which should be defered by the caller for cleanup.
func setup(t *testing.T) func() {
        ...
        cmd := exec.Command("sshd", "-f", configfile, "-i")
        if err := cmd.Run(); err != nil {
                t.Skipf("could not execute mock ssh server: %v", err)
        }
        ...
        return func() {
                // stop subprocess and cleanup
        }
}

func TestDialMockServer(t *testing.T) {
        cleanup := setup(t)
        defer cleanup()
        ...
}

In verbose mode tests that are skipped are now reported as a SKIP, rather than PASS.

Link to discussion: https://groups.google.com/d/topic/golang-nuts/BqorNARzt4U/discussion

R=adg, rsc, r, n13m3y3r
CC=golang-dev, minux.ma
https://codereview.appspot.com/6501094
go/build: ImportDir reject directories that don't exist

Fixes issue 3428.

R=dave, remyoudompheng, rsc
CC=golang-dev
https://codereview.appspot.com/7129048
net/url: generate correct Path when hostname empty

Parse("file:///foo") previously returned a URL with Scheme "file"
and Path "///foo". Now it returns a URL with Path "/foo",
such that
        &URL{Scheme: "file", Path: "/foo"}.String() == "file:///foo"

This means that parsing and stringifying the URL "file:/foo"
returns "file:///foo", technically a regression but one that only
affects a corner case.

Fixes issue 4189.

R=bradfitz, rsc
CC=golang-dev
https://codereview.appspot.com/7135051
net/url: use bytes.Buffer in (*URL).String

BenchmarkString before:

        11990 ns/op            1621 B/op         73 allocs/op

Using bytes.Buffer:

        8774 ns/op            1994 B/op         40 allocs/op

I also tried making a version of escape() that writes directly to the
bytes.Buffer, but it only saved 1 alloc/op and increased CPU time by
about 10%. Didn't seem worth the extra code path.

R=bradfitz
CC=golang-dev
https://codereview.appspot.com/7182050
time: make TestReset more reliable

Fixes issue 4690

R=golang-dev, alex.brainman, mikioh.mikioh
CC=golang-dev
https://codereview.appspot.com/7181052
go/build: fix TestBogusDirectory format and maybe Windows failure

R=golang-dev, adg
CC=golang-dev
https://codereview.appspot.com/7183046