cmd/go: handle \r in input text

Remove carriage returns from //go:generate lines.
Carriage returns are the predecessor of BOMs and still
live on Windows.

Fixes #9264

Change-Id: I637748c74335c696b3630f52f2100061153fcdb4
Reviewed-on: https://go-review.googlesource.com/1564
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
runtime: shrink initial arena if reservation fails

Fixes #9311

Change-Id: I2f142e65a54c0391084316d79a42714ba42dd8b9
Reviewed-on: https://go-review.googlesource.com/1514
Reviewed-by: Keith Randall <khr@golang.org>
runtime: if key type is reflexive, don't call equal(k, k)

Most types are reflexive (k == k for all k of type t), so don't
bother calling equal(k, k) when the key type is reflexive.

Change-Id: Ia716b4198b8b298687843b94b878dbc5e8fc2c65
Reviewed-on: https://go-review.googlesource.com/1480
Reviewed-by: Russ Cox <rsc@golang.org>
net/textproto: turn an ancient DoS BUG annotation into a comment

Actually fixing this "bug" would be weird, since io.LimitReader already
does what we need, as demonstrated by net/http's use.

Thanks to @davidfstr for pointing this out.

Change-Id: If707bcc698d1666a369b39ddfa9770685fbe3879
Reviewed-on: https://go-review.googlesource.com/1579
Reviewed-by: Rob Pike <r@golang.org>
doc: propose $GOPATH as $HOME/work, not $HOME/go

Related to issue #9228

Change-Id: I0819e657f6393788754d1412f9c2126a170d4cf1
Reviewed-on: https://go-review.googlesource.com/1577
Reviewed-by: Rob Pike <r@golang.org>
crypto/rand: handle EAGAIN reads from /dev/urandom

Fixes #9205

Change-Id: Iacd608ba43332008984aa8ece17dcb5757f27b3f
Reviewed-on: https://go-review.googlesource.com/1611
Reviewed-by: Ian Lance Taylor <iant@golang.org>
runtime: gofmt

Fixes #9339

Change-Id: I22faf2593cb73f42612c2c2bfe38de001fb2746b
Reviewed-on: https://go-review.googlesource.com/1630
Reviewed-by: Andrew Gerrand <adg@golang.org>
net/http: make Transport send 'Connection: close' when DisableKeepAlives

No bug was open, but I found an old email to myself to investigate
when I suspected this was happening.

Change-Id: Icedefec6f15a000eaabb2693b0640b3b6c8bf82c
Reviewed-on: https://go-review.googlesource.com/1578
Reviewed-by: Andrew Gerrand <adg@golang.org>
net/http/httputil: don't use DisableKeepAlives in DumpRequestOut, fix build

I broke the build in https://golang.org/change/207950a when I made
http.Transport send "Connection: close" request headers when
DisableKeepAlives was set true because I didn't run all the tests
before submitting.

httputil.DumpRequestOut used Transport to get its output, and used it
with DisableKeepAlives, so this changed the output.

Rather than updating golden data in our tests (because surely others
depend on the exact bytes from these in their tests), switch to not
using DisableKeepAlives in DumpRequestOut instead, so the output is
the same as before.

Change-Id: I9fad190be8032e55872e6947802055a6d65244df
Reviewed-on: https://go-review.googlesource.com/1632
Reviewed-by: Andrew Gerrand <adg@golang.org>
runtime: fix deadlock in runtime.Stack

It shouldn't semacquire() inside an acquirem(), the runtime
thinks that means deadlock.  It actually isn't a deadlock, but it
looks like it because acquirem() does m.locks++.

Candidate for inclusion in 1.4.1.  runtime.Stack with all=true
is pretty unuseable in GOMAXPROCS>1 environment.

fixes #9321

Change-Id: Iac6b664217d24763b9878c20e49229a1ecffc805
Reviewed-on: https://go-review.googlesource.com/1600
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
reflect: remove a double negative, use the rtype.pointers method for clarity

Change-Id: Ia24e9f0da1622cededa17b2c54ff9e4bb80cf946
Reviewed-on: https://go-review.googlesource.com/1633
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
runtime: add profiling infrastructure for the Concurrent GC

Change-Id: Ia7a007444eeb1503cec27367a5c6699ce0bf4af6
Reviewed-on: https://go-review.googlesource.com/1441
Reviewed-by: Austin Clements <austin@google.com>
test: add test that gccgo failed to compile

Gccgo failed to create the type descriptor for the type used to
allocate the nil value passed to append as the second argument when
append is called with only one argument.  Calling append with only one
argument is unusual but obviously should not cause a compiler crash.

Change-Id: I530821847dfd68f0302de6ca6a84dfbc79653935
Reviewed-on: https://go-review.googlesource.com/1692
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
os: handle the sticky bit separately for *BSD and Solaris

open(2) and mkdir(2) won't set the sticky bit on *BSD and Solaris.
This behavior is mentioned on sticky(8).
see also: https://github.com/dotcloud/docker/pull/6587

Fixes #8383.

Change-Id: Ic4733700f9926b9fc2b6fd1f998acec34e518764
Reviewed-on: https://go-review.googlesource.com/1673
Reviewed-by: Ian Lance Taylor <iant@golang.org>
doc: use 'git-codereview' in contributor docs

Change-Id: I63d5c81fdaf9aca2fc3da3defcc6e9c4094c690b
Reviewed-on: https://go-review.googlesource.com/1742
Reviewed-by: Andrew Gerrand <adg@golang.org>
doc: update source install instructions

Change-Id: I794a5773ed47d470ff91fcdd82f9747a91424eb4
Reviewed-on: https://go-review.googlesource.com/1402
Reviewed-by: Rob Pike <r@golang.org>
doc: fixes to contributor docs

Change-Id: Ib31fb1f8239d8113728bc4c6e411416721571341
Reviewed-on: https://go-review.googlesource.com/1743
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
test: add bug494: test case miscompiled by gccgo

Gccgo incorrectly executed functions multiple times when they appeared
in a composite literal that required a conversion between different
interface types.

Change-Id: I7b40e76ed23fa8440ffa03b262041265c109adf7
Reviewed-on: https://go-review.googlesource.com/1710
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
api: update next.txt

Change-Id: I9eac8b23eb9e6b6940069811177365b4772c2fb1
Reviewed-on: https://go-review.googlesource.com/1513
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
misc/chrome/gophertool: update for the git/gerrit transition

Change-Id: I7b9601ae6e1cfb18ef79a7b189aa7e689c0fe942
Reviewed-on: https://go-review.googlesource.com/1621
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>