doc/articles/laws_of_reflection.html: fix name of variable
Thanks to c.emil.hessman@gmail.com for pointing out the error.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/12572043
all: fix up language in a couple of comments
Leftovers from 11699043

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/12558046
net/http: treat HEAD requests like GET requests

A response to a HEAD request is supposed to look the same as a
response to a GET request, just without a body.

HEAD requests are incredibly rare in the wild.

The Go net/http package has so far treated HEAD requests
specially: a Write on our default ResponseWriter returned
ErrBodyNotAllowed, telling handlers that something was wrong.
This was to optimize the fast path for HEAD requests, but:

1) because HEAD requests are incredibly rare, they're not
   worth having a fast path for.

2) Letting the http.Handler handle but do nop Writes is still
   very fast.

3) this forces ugly error handling into the application.
   e.g. https://code.google.com/p/go/source/detail?r=6f596be7a31e
   and related.

4) The net/http package nowadays does Content-Type sniffing,
   but you don't get that for HEAD.

5) The net/http package nowadays does Content-Length counting
   for small (few KB) responses, but not for HEAD.

6) ErrBodyNotAllowed was useless. By the time you received it,
   you had probably already done all your heavy computation
   and I/O to calculate what to write.

So, this change makes HEAD requests like GET requests.

We now count content-length and sniff content-type for HEAD
requests. If you Write, it doesn't return an error.

If you want a fast-path in your code for HEAD, you have to do
it early and set all the response headers yourself. Just like
before. If you choose not to Write in HEAD requests, be sure
to set Content-Length if you know it. We won't write
"Content-Length: 0" because you might've just chosen to not
write (or you don't know your Content-Length in advance).

Fixes issue 5454

R=golang-dev, dsymonds
CC=golang-dev
https://codereview.appspot.com/12583043
net/http: do not send redundant Connection: close header in HTTP/1.0 responses

HTTP/1.0 connections are closed implicitly, unless otherwise specified.

Note that this change does not test or fix "request too large" responses.
Reasoning: (a) it complicates tests and fixes, (b) they should be rare,
and (c) this is just a minor wire optimization, and thus not really worth worrying
about in this context.

Fixes issue 5955.

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

Committer: Brad Fitzpatrick <bradfitz@golang.org>
net: fix small bug introduced by 48f7c4dd87fe

Fixes issue 6063

R=golang-dev, r, dave
CC=dvyukov, golang-dev
https://codereview.appspot.com/12586043
cmd/ld: Put the textflag constants in a separate file.
We can then include this file in assembly to replace
cryptic constants like "7" with meaningful constants
like "(NOPROF|DUPOK|NOSPLIT)".

Converting just pkg/runtime/asm*.s for now.  Dropping NOPROF
and DUPOK from lots of places where they aren't needed.
More .s files to come in a subsequent changelist.

A nonzero number in the textflag field now means
"has not been converted yet".

R=golang-dev, daniel.morsing, rsc, khr
CC=golang-dev
https://codereview.appspot.com/12568043
test: fix return.go to not use fallthrough in a type switch

The gc compiler only gives an error about fallthrough in a
type switch if it has not given any errors in an earlier pass.
Remove all functions in this test that use fallthrough in a
type switch because they don't test anything useful and they
cause gccgo to give unexpected errors.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/12614043
test: fix return.go to remove unused labels

The gc compiler only gives an error about an unused label if
it has not given any errors in an earlier pass.  Remove all
unused labels in this test because they don't test anything
useful and they cause gccgo to give unexpected errors.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/12580044
test: add cases to return.go that gccgo got wrong

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/12620043
net/http: Various fixes to Basic authentication

There were some issues with the code sometimes using base64.StdEncoding,
and sometimes base64.URLEncoding.
Encoding basic authentication is now always done by the same code.

Fixes issue 5970.

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

Committer: Brad Fitzpatrick <bradfitz@golang.org>
runtime: convert .s textflags from numbers to symbolic constants.
Remove NOPROF/DUPOK from everything.

Edits done with a script, except pclinetest.asm which depended
on the DUPOK flag on main().

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/12613044
cmd/cc, cmd/gc, runtime: emit bitmaps for scanning locals.

Previously, all word aligned locations in the local variables
area were scanned as conservative roots.  With this change, a
bitmap is generated describing the locations of pointer values
in local variables.

With this change the argument bitmap information has been
changed to only store information about arguments.  The locals
member, has been removed.  In its place, the bitmap data for
local variables is now used to store the size of locals.  If
the size is negative, the magnitude indicates the size of the
local variables area.

R=rsc
CC=golang-dev
https://codereview.appspot.com/12328044
runtime: do not run TestCgoSignalDeadlock on windows in short mode
The test takes up to 64 seconds on windows builders.
I've tried to reduce number of iterations in the test,
but it does not affect run time.
Fixes issue 6054.

R=golang-dev, alex.brainman
CC=golang-dev
https://codereview.appspot.com/12531043
runtime: fix traceback in cgo programs
Fixes issue 6061.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/12609043
build: change how cmd/api is run in run.bash and run.bat

In prep for Robert's forthcoming cmd/api rewrite which
depends on the go.tools subrepo, we'll need to be more
careful about how and when we run cmd/api.

Rather than implement this policy in both run.bash and
run.bat, this change moves the policy and mechanism into
cmd/api/run.go, which will then evolve.

The plan is in a TODO in run.go.

R=golang-dev, gri
CC=golang-dev
https://codereview.appspot.com/12482044
runtime: Record jmpdefer's argument size.
Fixes bug 6055.

R=golang-dev, bradfitz, dvyukov, khr
CC=golang-dev
https://codereview.appspot.com/12536045
flag: export commandLine, the previously internal default FlagSet
s/commandLine/CommandLine/g

Fixes issue 4209.

R=golang-dev, dsymonds, bradfitz
CC=golang-dev
https://codereview.appspot.com/12587043
doc/go1.2.txt: flag now exports CommandLine

R=golang-dev, dsymonds
CC=golang-dev
https://codereview.appspot.com/12642043
container/list: fix typo in comment
Fixes issue 6058.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/12643043
regexp/syntax: make it clearer that \b and \B are ASCII-defined
Fixes issue 5896.

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