doc/faq: update for 1.4

LGTM=iant
R=golang-codereviews, bradfitz, iant
CC=golang-codereviews
https://codereview.appspot.com/150190043
cmd/ld: don't automatically mark symbols created by -X as reachable

This fixes the bug in which the linker reports "missing Go
type information" when a -X option refers to a symbol that is
not used.

Fixes issue 8821.

LGTM=rsc
R=rsc, r
CC=golang-codereviews
https://codereview.appspot.com/151000043
runtime: fix cgo_topofstack to save clobbered registers

Fixes issue 8816

At least, I hope it does.

TBR=rsc
CC=golang-codereviews
https://codereview.appspot.com/153730043
cmd/ld: close outfile before cleanup

This prevents the temporary directory from being leaked when
the linker is run on a FUSE filesystem.

Fixes issue 8684.

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

Committer: Brad Fitzpatrick <bradfitz@golang.org>
C: add Andres Erbsen (Google CLA)

LGTM=bradfitz, minux
R=bradfitz, minux
CC=golang-codereviews
https://codereview.appspot.com/119540043
go/build: add go1.4 tag.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://codereview.appspot.com/138000044
net: fix misleading package comment example

Fixes Issue 8607

LGTM=r
R=r
CC=golang-codereviews
https://codereview.appspot.com/146470043
crypto/x509: accept CRLs without an expiry.

RFC5280 says that the nextUpdate field is optional.

Fixes issue 8085.

R=bradfitz
CC=golang-codereviews
https://codereview.appspot.com/149770044
spec: specify variable initialization order explicitly

The existing spec rules on package initialization were
contradictory: They specified that 1) dependent variables
are initialized in dependency order, and 2) independent
variables are initialized in declaration order. This 2nd
rule cannot be satisfied in general. For instance, for

var (
        c = b + 2
        a = 0
        b = 1
)

because of its dependency on b, c must be initialized after b,
leading to the partial order b, c. Because a is independent of
b but is declared before b, we end up with the order: a, b, c.
But a is also independent of c and is declared after c, so the
order b, c, a should also be valid in contradiction to a, b, c.

The new rules are given in form of an algorithm which outlines
initialization order explicitly.

gccgo and go/types already follow these rules.

Fixes issue 8485.

LGTM=iant, r, rsc
R=r, rsc, iant, ken, gordon.klaus, adonovan
CC=golang-codereviews
https://codereview.appspot.com/142880043
undo CL 141840043 / 65e21380cb2a

Unnecessary; covered by https://codereview.appspot.com/141690043

Verified by jonathan@titanous.com on golang-dev.

??? original CL description
cmd/ld: close outfile before cleanup

This prevents the temporary directory from being leaked when
the linker is run on a FUSE filesystem.

Fixes issue 8684.

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

Committer: Brad Fitzpatrick <bradfitz@golang.org>
???

LGTM=jonathan, iant
R=iant, jonathan
CC=golang-codereviews
https://codereview.appspot.com/150250045
cmd/yacc: fix handling of tokens that don't start with letters

CL 149110043 changed yacc to no longer keep a leading space
for quoted tokens.  That is OK by itself but unfortunately
yacc was relying on that leading space to notice which tokens
it should not output as const declarations.

Add a few such tokens to expr.y, although it won't make any
immediate difference as we seem to have no tests for yacc.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://codereview.appspot.com/152720043
net/http: clarify Request.FormValue docs

Fixes Issue 8067

LGTM=r
R=r
CC=golang-codereviews
https://codereview.appspot.com/146480043
net/http: enable Transfer-Encoding: identity without Content-Length for HTTP 1.1.

Use case is SSE recommended configuration: http://www.w3.org/TR/eventsource/#notes
Removes a TODO.

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

Committer: Brad Fitzpatrick <bradfitz@golang.org>
runtime: delete unused variables.

We're not comparing with code addresses any more.  Instead,
we use nil algorithm functions to mark uncomparable types.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/151040044
A+C: Tom Linford (individual CLA)

Generated by a+c.

R=gobot
CC=golang-codereviews
https://codereview.appspot.com/149260044
x509: add root certs for android.

On android, root certificates appear to be stored in the folder
/system/etc/security/cacerts, which has many certs in several
different files. This change adds a new array of directories in
which certs can be found.

To test this, I simply tried making a request with the http
library to an HTTPS URL on an android emulator and manually
verified that it worked.

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

Committer: David Crawshaw <david.crawshaw@zentus.com>
liblink: generate MRC replacement in liblink, not tls_arm

Fixes issue 8690.

This CL moves the save of LR around BL runtime.read_tls_fallback to liblink as it is not needed when MRC is not replaced.

LGTM=rsc, minux
R=rsc, khr, minux
CC=golang-codereviews
https://codereview.appspot.com/147310043
go/format, cmd/gofmt: fix issues with partial Go code with indent

Fixes issue 5551.
Fixes issue 4449.

Adds tests for both issues.

Note that the two issues occur only when formatting partial Go code
with indent.

The best way to understand the change is as follows: I took the code
of cmd/gofmt and go/format, combined it into one unified code that
does not suffer from either 4449 nor 5551, and then applied that code
to both cmd/gofmt and go/format.

As a result, there is now much more identical code between the two
packages, making future code deduplication easier (it was not possible
to do that now without adding public APIs, which I was advised not to
do at this time).

More specifically, I took the parse() of cmd/gofmt which correctly
preserves comments (issue 5551) and modified it to fix issue where
it would sometimes modify literal values (issue 4449).

I ended up removing the matchSpace() function because it no longer
needed to do some of its work (insert indent), and a part of its work
had to be done in advance (determining the indentation of first code
line), because that calculation is required for cfg.Fprint() to run.

adjustIndent is used to adjust the indent of cfg.Fprint() to compensate
for the body of wrapper func being indented by one level. This allows
to get rid of the bytes.Replace text manipulation of inner content,
which was problematic and sometimes altered raw string literals (issue
4449). This means that sometimes the value of cfg.Indent is negative,
but that works as expected.

So now the algorithm for formatting partial Go code is:

1. Determine and prepend leading space of original source.
2. Determine and prepend indentation of first code line.
3. Format and write partial Go code (with all of its leading &
   trailing space trimmed).
4. Determine and append trailing space of original source.

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

Committer: Robert Griesemer <gri@golang.org>
net/http: make Transport.CloseIdleConnections also close pending dials

See comment 4 of https://code.google.com/p/go/issues/detail?id=8483#c4:

"So if a user creates a http.Client, issues a bunch of
requests and then wants to shutdown it and all opened connections;
what is she intended to do? The report suggests that just waiting for
all pending requests and calling CloseIdleConnections won't do, as
there can be new racing connections. Obviously she can't do what
you've done in the test, as it uses the unexported function.  If this
happens periodically, it can lead to serious resource leaks (the
transport is also preserved alive).  Am I missing something?"

This CL tracks the user's intention to close all idle
connections (CloseIdleConnections sets it true; and making a
new request sets it false). If a pending dial finishes and
nobody wants it, before it's retained for a future caller, the
"wantIdle" bool is checked and it's closed if the user has
called CloseIdleConnections without a later call to make a new
request.

Fixes Issue 8483

LGTM=adg
R=golang-codereviews, dvyukov, adg
CC=golang-codereviews, rsc
https://codereview.appspot.com/148970043
runtime: initialize traceback variables earlier

Our traceback code needs to know the PC of several special
functions, including goexit, mcall, etc.  Make sure that
these PCs are initialized before any traceback occurs.

Fixes issue 8766

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