]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agoruntime/pprof: disable flaky TestGoroutineSwitch on windows
Alex Brainman [Tue, 15 Oct 2013 02:00:06 +0000 (13:00 +1100)]
runtime/pprof: disable flaky TestGoroutineSwitch on windows

Update #6417

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/14604043

11 years agocmd/gc: fix comment about performing indexing at compile time.
Keith Randall [Mon, 14 Oct 2013 21:26:52 +0000 (14:26 -0700)]
cmd/gc: fix comment about performing indexing at compile time.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14441070

11 years agonet/http: skip content-type sniffing if the header is explicitly unset.
Michael Piatek [Mon, 14 Oct 2013 21:22:04 +0000 (08:22 +1100)]
net/http: skip content-type sniffing if the header is explicitly unset.

Fixes #5953

R=dsymonds, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/14434044

11 years agoC: add Michael Piatek (Google CLA).
David Symonds [Mon, 14 Oct 2013 21:21:30 +0000 (08:21 +1100)]
C: add Michael Piatek (Google CLA).

R=golang-dev, r
CC=golang-dev, piatek
https://golang.org/cl/14681043

11 years agodebug/dwarf: report the value of an unrecognized attribute format
Ian Lance Taylor [Mon, 14 Oct 2013 17:53:55 +0000 (10:53 -0700)]
debug/dwarf: report the value of an unrecognized attribute format

R=golang-dev, r, minux.ma
CC=golang-dev
https://golang.org/cl/14669045

11 years agocmd/api: make it work even when cgo is disabled
Shenghou Ma [Mon, 14 Oct 2013 04:18:46 +0000 (00:18 -0400)]
cmd/api: make it work even when cgo is disabled
make use of $USER or %USERNAME% to determine the current user.
Fixes #6578.

R=golang-dev, bradfitz, alex.brainman
CC=golang-dev
https://golang.org/cl/14649043

11 years agodoc: fix small HTML problems
Shenghou Ma [Sat, 12 Oct 2013 22:40:41 +0000 (18:40 -0400)]
doc: fix small HTML problems

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/14629043

11 years agodoc/effective_go.html: fix unescaped less-than character
Rob Pike [Fri, 11 Oct 2013 23:39:40 +0000 (16:39 -0700)]
doc/effective_go.html: fix unescaped less-than character
Why doesn't tidy complain about these?
Found by manlio.perillo.
Fixes #6571

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/14608044

11 years agogo/build: add GOOS and GOARCH to name of gccgo pkg directory
Ian Lance Taylor [Fri, 11 Oct 2013 23:17:45 +0000 (16:17 -0700)]
go/build: add GOOS and GOARCH to name of gccgo pkg directory

This matches the behaviour of builder.includeArgs in
cmd/go/build.go.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/14535048

11 years agogo/build: fix test if built with CGO_ENABLED=0
Ian Lance Taylor [Fri, 11 Oct 2013 22:55:50 +0000 (15:55 -0700)]
go/build: fix test if built with CGO_ENABLED=0

Fixes #6567.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/14502060

11 years agomisc/cgo/test: fix C panic test to work with gccgo
Ian Lance Taylor [Fri, 11 Oct 2013 18:24:54 +0000 (11:24 -0700)]
misc/cgo/test: fix C panic test to work with gccgo

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/14611043

11 years agodoc/progs: don't try building cgo tests if CGO_ENABLED=0
Ian Lance Taylor [Fri, 11 Oct 2013 15:55:13 +0000 (08:55 -0700)]
doc/progs: don't try building cgo tests if CGO_ENABLED=0

R=golang-dev, jsing, r
CC=golang-dev
https://golang.org/cl/14523056

11 years agocmd/gc: re-word some error messages
Shenghou Ma [Fri, 11 Oct 2013 02:43:34 +0000 (22:43 -0400)]
cmd/gc: re-word some error messages
Fixes #6557.

R=golang-dev, rsc, tracey.brendan
CC=golang-dev
https://golang.org/cl/14432053

11 years agogo.tools/misc/dist: copy doc.go from go.tools to go root
Andrew Gerrand [Fri, 11 Oct 2013 01:37:32 +0000 (10:37 +0900)]
go.tools/misc/dist: copy doc.go from go.tools to go root

This will allow "godoc godoc", "godoc vet", "godoc cover" to work.

Fixes #6527.

R=r, dsymonds
CC=golang-dev
https://golang.org/cl/14566049

11 years agomisc/vim: complete packages in src directory
Yasuhiro Matsumoto [Fri, 11 Oct 2013 00:30:03 +0000 (11:30 +1100)]
misc/vim: complete packages in src directory

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/14454059

11 years agodoc/effective_go.html: fix a couple of cosmetic issues
Rob Pike [Fri, 11 Oct 2013 00:26:03 +0000 (17:26 -0700)]
doc/effective_go.html: fix a couple of cosmetic issues
At the moment, godoc expands the example in the link, but in
the past it has not. Add a waffle word to allow either possibility.
Also change the order of cases in the switch in Compare to
be consistent with the other switch in the function.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/14439055

11 years agolib/codereview: return an empty list when CONTRIBUTORS is not found instead of None.
Francesc Campoy [Fri, 11 Oct 2013 00:16:17 +0000 (17:16 -0700)]
lib/codereview: return an empty list when CONTRIBUTORS is not found instead of None.

R=adg, campoy, r
CC=golang-dev
https://golang.org/cl/14419059

11 years agocodereview: fix hg sync closing of CLs for subrepositories
Dominik Honnef [Thu, 10 Oct 2013 23:30:47 +0000 (16:30 -0700)]
codereview: fix hg sync closing of CLs for subrepositories

The regexp for closing CLs that were sent by you but committed by
someone else only matched messages for the main repository,
because of the added &repo=... for subrepositories.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14512045

11 years agomisc/emacs: send correct content-length to the playground
Dominik Honnef [Thu, 10 Oct 2013 20:49:19 +0000 (16:49 -0400)]
misc/emacs: send correct content-length to the playground

R=adonovan
CC=golang-dev
https://golang.org/cl/14548049

11 years agomisc/emacs: don't treat (foo)(bar) as a function call when preceded by a word character.
Dominik Honnef [Thu, 10 Oct 2013 20:30:20 +0000 (16:30 -0400)]
misc/emacs: don't treat (foo)(bar) as a function call when preceded by a word character.

Fixes #6531.

R=adonovan
CC=golang-dev
https://golang.org/cl/14523043

11 years agonet: fix TestDialFailPDLeak to work when GOMAXPROCS is large
Ian Lance Taylor [Wed, 9 Oct 2013 20:52:29 +0000 (13:52 -0700)]
net: fix TestDialFailPDLeak to work when GOMAXPROCS is large

Fixes #6553.

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/14526048

11 years agoruntime: markfreed's error reports should be prefixed with "markfreed", not "markallo...
Keith Randall [Wed, 9 Oct 2013 20:28:47 +0000 (13:28 -0700)]
runtime: markfreed's error reports should be prefixed with "markfreed", not "markallocated".

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/14441055

11 years agocmd/go: add any .c/.cc files to the SWIG shared library
Ian Lance Taylor [Wed, 9 Oct 2013 17:35:46 +0000 (10:35 -0700)]
cmd/go: add any .c/.cc files to the SWIG shared library

Also add the action's object directory to the list of
directories we use to find SWIG shared libraries.

Fixes #6521.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/14369043

11 years agoruntime/cgo: mark callback functions as NOSPLIT
Ian Lance Taylor [Wed, 9 Oct 2013 15:44:47 +0000 (08:44 -0700)]
runtime/cgo: mark callback functions as NOSPLIT

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/14448044

11 years agodebug/dwarf: handle surprising clang encoding
Russ Cox [Wed, 9 Oct 2013 15:08:22 +0000 (11:08 -0400)]
debug/dwarf: handle surprising clang encoding

Fixes a bug in cgo on OS X using clang.
See golang.org/issue/6472 for details.

Fixes #6472.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/14575043

11 years agonet: fix typo in failure message in test
Ian Lance Taylor [Wed, 9 Oct 2013 13:44:11 +0000 (06:44 -0700)]
net: fix typo in failure message in test

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/14582043

11 years agocompress/flate: fix infinite loop on malformed data
Russ Cox [Wed, 9 Oct 2013 12:37:06 +0000 (08:37 -0400)]
compress/flate: fix infinite loop on malformed data

Test using compress/gzip, because that's how the
data arrived.

Fixes #6550.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14441051

11 years agolib/time: update time zone files to version 2013g
Rob Pike [Tue, 8 Oct 2013 23:16:24 +0000 (16:16 -0700)]
lib/time: update time zone files to version 2013g
This dataset is current as of Sep 30, 2013.

Fixes #6524

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/14570044

11 years agoencoding/gob: add examples
Rob Pike [Tue, 8 Oct 2013 20:13:40 +0000 (13:13 -0700)]
encoding/gob: add examples
Also tweak the package document, putting in section headings and
adding a sentence about intended use.

Fixes #4925.

R=golang-dev, iant, adg, ugorji
CC=golang-dev
https://golang.org/cl/14519044

11 years agodoc: fix a few broken links
Andrew Gerrand [Tue, 8 Oct 2013 20:05:43 +0000 (07:05 +1100)]
doc: fix a few broken links

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14494044

11 years agotest: revert changes made for Go SSA interpreter test.
Alan Donovan [Tue, 8 Oct 2013 18:36:20 +0000 (14:36 -0400)]
test: revert changes made for Go SSA interpreter test.

R=r, gri
CC=golang-dev
https://golang.org/cl/14552044

11 years agocmd/go, runtime: express armv5t architecture constraint differently
Carl Shapiro [Tue, 8 Oct 2013 17:40:51 +0000 (10:40 -0700)]
cmd/go, runtime: express armv5t architecture constraint differently

Instead of adding an -march=armv5t flag to the gcc command
line, the same effect is obtained with an ".arch armv5t"
pseudo op in the assembly file that uses armv5t instructions.

R=golang-dev, iant, dave
CC=golang-dev
https://golang.org/cl/14511044

11 years agoA+C: Tw (individual CLA)
Andrew Gerrand [Tue, 8 Oct 2013 05:53:56 +0000 (16:53 +1100)]
A+C: Tw (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/14502047

11 years agodoc/articles/wiki: fix path handling and clean up test process
Andrew Gerrand [Tue, 8 Oct 2013 00:14:35 +0000 (11:14 +1100)]
doc/articles/wiki: fix path handling and clean up test process

Fixes #6525.

R=r
CC=golang-dev
https://golang.org/cl/14383043

11 years agomath: the trig functions work in radians; document that
Rob Pike [Mon, 7 Oct 2013 23:32:47 +0000 (16:32 -0700)]
math: the trig functions work in radians; document that
Fixes #6543
6543 is also a fine NGC object.

R=golang-dev, dsymonds, kamil.kisiel, minux.ma
CC=golang-dev
https://golang.org/cl/14515044

11 years agospec: unsafe.Pointers are pointers
Robert Griesemer [Mon, 7 Oct 2013 17:43:28 +0000 (10:43 -0700)]
spec: unsafe.Pointers are pointers

But they cannot be dereferenced.
See also issue 6116.

Fixes #6358.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/14374046

11 years agomisc/emacs: find unused imports where path and package name differ
Dominik Honnef [Mon, 7 Oct 2013 17:08:26 +0000 (13:08 -0400)]
misc/emacs: find unused imports where path and package name differ

The Go compiler emits extra information for this case:

imported and not used: "sandbox/foo_bar" as bar

R=adonovan
CC=golang-dev
https://golang.org/cl/14111043

11 years agoos/user: fix user lookups on dragonfly
Joel Sing [Mon, 7 Oct 2013 16:21:33 +0000 (09:21 -0700)]
os/user: fix user lookups on dragonfly

Like FreeBSD, DragonFly does not provide a sysconf value for
_SC_GETPW_R_SIZE_MAX.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/14469043

11 years agoos/user: enable tests on all supported platforms
Joel Sing [Mon, 7 Oct 2013 16:12:17 +0000 (09:12 -0700)]
os/user: enable tests on all supported platforms

All of the currently supported platforms have a working user
implementation and do not use stubs. As a result, enable the tests
on all platforms rather than whitelisting.

R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/14454044

11 years agoos/signal: make test logs reflect reality
Joel Sing [Mon, 7 Oct 2013 16:04:20 +0000 (09:04 -0700)]
os/signal: make test logs reflect reality

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/14470043

11 years agocodereview: move dotfiles out of user home director to something sane.
Jeff Sickel [Mon, 7 Oct 2013 15:41:27 +0000 (11:41 -0400)]
codereview: move dotfiles out of user home director to something sane.

See Rob Pike's lesson on shortcuts, https://plus.google.com/101960720994009339267/posts/R58WgWwN9jp

R=golang-dev, r, rsc
CC=aram.h, golang-dev
https://golang.org/cl/14374045

11 years agoA+C: Jeff Sickel (individual CLA)
Russ Cox [Mon, 7 Oct 2013 15:40:59 +0000 (11:40 -0400)]
A+C: Jeff Sickel (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/14467045

11 years agoA+C: add Marko Juhani Silokunnas (individual CLA).
David Symonds [Sat, 5 Oct 2013 04:15:02 +0000 (14:15 +1000)]
A+C: add Marko Juhani Silokunnas (individual CLA).

R=golang-dev, adg
CC=golang-dev, mikioh.mikioh
https://golang.org/cl/14417043

11 years agoruntime: fix bug in maps at the intersection of iterators, growing, and NaN keys
Keith Randall [Fri, 4 Oct 2013 20:54:03 +0000 (13:54 -0700)]
runtime: fix bug in maps at the intersection of iterators, growing, and NaN keys

If an iterator is started while a map is in the middle of a grow,
and the map has NaN keys, then those keys might get returned by
the iterator more than once.  This fix makes the evacuation decision
deterministic and repeatable for NaN keys so each one gets returned
only once.

R=golang-dev, r, khr, iant
CC=golang-dev
https://golang.org/cl/14367043

11 years agoruntime: remove 3 unused declarations.
Keith Randall [Fri, 4 Oct 2013 20:22:20 +0000 (13:22 -0700)]
runtime: remove 3 unused declarations.

R=golang-dev, cshapiro, iant
CC=golang-dev
https://golang.org/cl/14405043

11 years agoreflect: test using a MakeFunc value in a couple of different ways
Ian Lance Taylor [Fri, 4 Oct 2013 20:12:50 +0000 (13:12 -0700)]
reflect: test using a MakeFunc value in a couple of different ways

The gccgo implementation mishandled calling Interface on a
value created by MakeFunc.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14401043

11 years agodoc/go1.2.html: update a minor change to syscall
Mikio Hara [Fri, 4 Oct 2013 04:13:56 +0000 (13:13 +0900)]
doc/go1.2.html: update a minor change to syscall

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14379043

11 years agoruntime: collect profiles even while on g0 stack
Alex Brainman [Fri, 4 Oct 2013 03:53:34 +0000 (13:53 +1000)]
runtime: collect profiles even while on g0 stack

Fixes #6417

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/14231047

11 years agoA+C: Matt Reiferson (individual CLA)
Andrew Gerrand [Fri, 4 Oct 2013 01:46:32 +0000 (11:46 +1000)]
A+C: Matt Reiferson (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/14375043

11 years agodoc: move spec and memory model back to /ref/
Andrew Gerrand [Thu, 3 Oct 2013 23:45:06 +0000 (09:45 +1000)]
doc: move spec and memory model back to /ref/

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14364043

11 years agospec: added additional links, added missing 'label'
Robert Griesemer [Thu, 3 Oct 2013 23:38:22 +0000 (16:38 -0700)]
spec: added additional links, added missing 'label'

No semantic spec changes.

R=r
CC=golang-dev
https://golang.org/cl/14363043

11 years agoreflect: add a test that gccgo mishandled
Ian Lance Taylor [Thu, 3 Oct 2013 20:23:02 +0000 (13:23 -0700)]
reflect: add a test that gccgo mishandled

Failure occurred when using reflect.Call to pass a func value
following a non-pointer value.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14186043

11 years agospec: fix small typo in comment for example
Robert Hencke [Thu, 3 Oct 2013 19:46:02 +0000 (12:46 -0700)]
spec: fix small typo in comment for example

R=golang-dev, mirtchovski, r
CC=golang-dev
https://golang.org/cl/14227043

11 years agogofmt: explain why lower bounds aren't automatically simplified
Robert Hencke [Thu, 3 Oct 2013 17:55:17 +0000 (10:55 -0700)]
gofmt: explain why lower bounds aren't automatically simplified

Full credit goes to gri and rsc for their explanations.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14229043

11 years agodoc: remove link to PackageVersioning wiki
Russ Cox [Thu, 3 Oct 2013 17:53:16 +0000 (13:53 -0400)]
doc: remove link to PackageVersioning wiki

That page may be fine for experienced Go programmers
but it's not really targeting new programmers.
There's too much we don't know yet.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14345043

11 years agosync/atomic: explain how to subtract an unsigned constant
Rob Pike [Thu, 3 Oct 2013 17:40:42 +0000 (10:40 -0700)]
sync/atomic: explain how to subtract an unsigned constant
Explain for those unfamiliar with twos-complement arithmetic how to
implement negation of signed positive constant.
Fixes #6408.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/14267044

11 years agogo/doc: update ToHTML doc comment
Russ Cox [Thu, 3 Oct 2013 13:49:12 +0000 (09:49 -0400)]
go/doc: update ToHTML doc comment

Update #5429

R=golang-dev, r, dan.kortschak
CC=golang-dev
https://golang.org/cl/14293043

11 years agoruntime: change default stack segment size to 8 kB
Russ Cox [Thu, 3 Oct 2013 13:19:10 +0000 (09:19 -0400)]
runtime: change default stack segment size to 8 kB

Changing from 4 kB to 8 kB brings significant improvement
on a variety of the Go 1 benchmarks, on both amd64
and 386 systems.

Significant runtime reductions:

          amd64  386
GoParse    -14%  -1%
GobDecode  -12% -20%
GobEncode  -64%  -1%
JSONDecode  -9%  -4%
JSONEncode -15%  -5%
Template   -17% -14%

In the longer term, khr's new stacks will avoid needing to
make this decision at all, but for Go 1.2 this is a reasonable
stopgap that makes performance significantly better.

Demand paging should mean that if the second 4 kB is not
used, it will not be brought into memory, so the change
should not adversely affect resident set size.
The same argument could justify bumping as high as 64 kB
on 64-bit machines, but there are diminishing returns
after 8 kB, and using 8 kB limits the possible unintended
memory overheads we are not aware of.

Benchmark graphs at
http://swtch.com/~rsc/gostackamd64.html
http://swtch.com/~rsc/gostack386.html

Full data at
http://swtch.com/~rsc/gostack.zip

R=golang-dev, khr, dave, bradfitz, dvyukov
CC=golang-dev
https://golang.org/cl/14317043

11 years agodoc/faq: add a FAQ about versioning
Russ Cox [Thu, 3 Oct 2013 13:18:47 +0000 (09:18 -0400)]
doc/faq: add a FAQ about versioning

Fixes #5633.

R=golang-dev, r, tommi.virtanen, adg, nj
CC=golang-dev
https://golang.org/cl/14283044

11 years agocmd/gc: support -installsuffix in the compiler and builder
Dave Day [Thu, 3 Oct 2013 03:48:47 +0000 (13:48 +1000)]
cmd/gc: support -installsuffix in the compiler and builder

Add the -installsuffix flag to gc and {5,6,8}l, which overrides -race
for the suffix if both are supplied.
Pass this flag from the go tool for build and install.

R=rsc
CC=golang-dev
https://golang.org/cl/14246044

11 years agomisc/vim: Autocompletion for :Godoc command
Yasuhiro Matsumoto [Thu, 3 Oct 2013 03:32:07 +0000 (13:32 +1000)]
misc/vim: Autocompletion for :Godoc command

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/14259043

11 years agonet: use original argument in lookup error
Russ Cox [Thu, 3 Oct 2013 02:09:54 +0000 (22:09 -0400)]
net: use original argument in lookup error

Fixes #6324.

R=golang-dev, iant, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/13280049

11 years agocmd/go: document relative imports
Russ Cox [Thu, 3 Oct 2013 01:42:23 +0000 (21:42 -0400)]
cmd/go: document relative imports

Fixes #3524.

R=golang-dev, iant, r
CC=golang-dev
https://golang.org/cl/14296043

11 years agocrypto/tls: document ConnectionState fields
Russ Cox [Thu, 3 Oct 2013 01:40:01 +0000 (21:40 -0400)]
crypto/tls: document ConnectionState fields

Fixes #6456.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14289043

11 years agoruntime: remove syscall.NewCallbackCDecl on Windows
Russ Cox [Thu, 3 Oct 2013 01:39:45 +0000 (21:39 -0400)]
runtime: remove syscall.NewCallbackCDecl on Windows

It is not possible to use (there is no declaration in package syscall),
and no one seems to care.

Alex Brainman may bring this back properly for Go 1.3.

Fixes #6338.

R=golang-dev, r, alex.brainman
CC=golang-dev
https://golang.org/cl/14287043

11 years agomisc/dist: support building statically linked toolchain.
Shenghou Ma [Thu, 3 Oct 2013 00:14:54 +0000 (20:14 -0400)]
misc/dist: support building statically linked toolchain.
so that we don't need worry about specifying the required
libc version (note: as cmd/go will still be dynamically
linked to libc, we still need to perform the build on OSes
with an old enough libc. But as cmd/go doesn't rely on many
libc symbols, the situation should be significantly better).

Fixes #3564.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/14261043

11 years agoencoding/json: add an example for RawMessage
Josh Bleecher Snyder [Wed, 2 Oct 2013 22:52:18 +0000 (08:52 +1000)]
encoding/json: add an example for RawMessage

RawMessage is useful and mildly non-obvious.
Given the frequency with which RawMessage questions
show up on golang-nuts, and get answered with an example,
I suspect adding an example to the docs might help.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/14190044

11 years agodoc/effective_go: fix server example that shares var between goroutines
Rob Pike [Wed, 2 Oct 2013 18:35:25 +0000 (11:35 -0700)]
doc/effective_go: fix server example that shares var between goroutines
Use it as a teaching example about how to solve this problem.

Fixes #6501

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/14250043

11 years agonet/http: be clear that HTTPS is supported
Russ Cox [Wed, 2 Oct 2013 17:21:15 +0000 (13:21 -0400)]
net/http: be clear that HTTPS is supported

Fixes #6443.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/14231045

11 years agoruntime: fix finalizer test on amd64
Russ Cox [Wed, 2 Oct 2013 16:30:49 +0000 (12:30 -0400)]
runtime: fix finalizer test on amd64

Not scanning the stack by frames means we are reintroducing
a few false positives into the collection. Run the finalizer registration
in its own goroutine so that stack is guaranteed to be out of
consideration in a later collection.

This is working around a regression from yesterday's tip, but
it's not a regression from Go 1.1.

R=golang-dev
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/14290043

11 years agocmd/gc: qualified embedded fields with owner package.
Rémy Oudompheng [Wed, 2 Oct 2013 16:27:33 +0000 (12:27 -0400)]
cmd/gc: qualified embedded fields with owner package.

R=rsc
CC=golang-dev
https://golang.org/cl/14188044

11 years agocrypto/tls: Update reference to the TLS 1.2 RFC.
Frithjof Schulze [Wed, 2 Oct 2013 16:09:13 +0000 (12:09 -0400)]
crypto/tls: Update reference to the TLS 1.2 RFC.

Ticket 13740047 updated the documented TLS version to 1.2.
This also updates the RFC refered to.

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/14029043

11 years agoruntime: do not scan stack by frames during garbage collection
Russ Cox [Wed, 2 Oct 2013 15:59:53 +0000 (11:59 -0400)]
runtime: do not scan stack by frames during garbage collection

Walking the stack by frames is ~3x more expensive
than not, and since it didn't end up being precise,
there is not enough benefit to outweigh the cost.

This is the conservative choice: this CL makes the
stack scanning behavior the same as it was in Go 1.1.

Add benchmarks to package runtime so that we have
them when we re-enable this feature during the
Go 1.3 development.

benchmark                     old ns/op    new ns/op    delta
BenchmarkGoroutineSelect        3194909      1272092  -60.18%
BenchmarkGoroutineBlocking      3120282       866366  -72.23%
BenchmarkGoroutineForRange      3256179       939902  -71.13%
BenchmarkGoroutineIdle          2005571       482982  -75.92%

The Go 1 benchmarks, just to add more data.
As far as I can tell the changes are mainly noise.

benchmark                         old ns/op    new ns/op    delta
BenchmarkBinaryTree17            4409403046   4414734932   +0.12%
BenchmarkFannkuch11              3407708965   3378306120   -0.86%
BenchmarkFmtFprintfEmpty                100           99   -0.60%
BenchmarkFmtFprintfString               242          239   -1.24%
BenchmarkFmtFprintfInt                  204          206   +0.98%
BenchmarkFmtFprintfIntInt               320          316   -1.25%
BenchmarkFmtFprintfPrefixedInt          295          299   +1.36%
BenchmarkFmtFprintfFloat                442          435   -1.58%
BenchmarkFmtManyArgs                   1246         1216   -2.41%
BenchmarkGobDecode                 10186951     10051210   -1.33%
BenchmarkGobEncode                 16504381     16445650   -0.36%
BenchmarkGzip                     447030885    447056865   +0.01%
BenchmarkGunzip                   111056154    111696305   +0.58%
BenchmarkHTTPClientServer             89973        93040   +3.41%
BenchmarkJSONEncode                28174182     27933893   -0.85%
BenchmarkJSONDecode               106353777    110443817   +3.85%
BenchmarkMandelbrot200              4822289      4806083   -0.34%
BenchmarkGoParse                    6102436      6142734   +0.66%
BenchmarkRegexpMatchEasy0_32            133          132   -0.75%
BenchmarkRegexpMatchEasy0_1K            372          373   +0.27%
BenchmarkRegexpMatchEasy1_32            113          111   -1.77%
BenchmarkRegexpMatchEasy1_1K            964          940   -2.49%
BenchmarkRegexpMatchMedium_32           202          205   +1.49%
BenchmarkRegexpMatchMedium_1K         68862        68858   -0.01%
BenchmarkRegexpMatchHard_32            3480         3407   -2.10%
BenchmarkRegexpMatchHard_1K          108255       112614   +4.03%
BenchmarkRevcomp                  751393035    743929976   -0.99%
BenchmarkTemplate                 139637041    135402220   -3.03%
BenchmarkTimeParse                      479          475   -0.84%
BenchmarkTimeFormat                     460          466   +1.30%

benchmark                          old MB/s     new MB/s  speedup
BenchmarkGobDecode                    75.34        76.36    1.01x
BenchmarkGobEncode                    46.50        46.67    1.00x
BenchmarkGzip                         43.41        43.41    1.00x
BenchmarkGunzip                      174.73       173.73    0.99x
BenchmarkJSONEncode                   68.87        69.47    1.01x
BenchmarkJSONDecode                   18.25        17.57    0.96x
BenchmarkGoParse                       9.49         9.43    0.99x
BenchmarkRegexpMatchEasy0_32         239.58       241.74    1.01x
BenchmarkRegexpMatchEasy0_1K        2749.74      2738.00    1.00x
BenchmarkRegexpMatchEasy1_32         282.49       286.32    1.01x
BenchmarkRegexpMatchEasy1_1K        1062.00      1088.96    1.03x
BenchmarkRegexpMatchMedium_32          4.93         4.86    0.99x
BenchmarkRegexpMatchMedium_1K         14.87        14.87    1.00x
BenchmarkRegexpMatchHard_32            9.19         9.39    1.02x
BenchmarkRegexpMatchHard_1K            9.46         9.09    0.96x
BenchmarkRevcomp                     338.26       341.65    1.01x
BenchmarkTemplate                     13.90        14.33    1.03x

Fixes #6482.

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/14257043

11 years agocmd/dist, build: support building statically linked toolchain
Shenghou Ma [Wed, 2 Oct 2013 03:44:20 +0000 (23:44 -0400)]
cmd/dist, build: support building statically linked toolchain

Added a new $GO_DISTFLAGS to make.bash, and while we're here,
added mention $CXX in make.bash (CL 13704044).

Fixes #6448.
Update #3564
We can pass GO_DISTFLAGS=-s from misc/dist to make.bash so that
it will build a statically linked toolchain.
(Note: OS X doesn't have the concept of static linking, so don't
pass GO_DISTFLAGS=-s for OS X builds)

R=adg, rsc, iant
CC=golang-dev
https://golang.org/cl/13887043

11 years agodoc: rename @go_nuts to @golang
Andrew Gerrand [Wed, 2 Oct 2013 01:46:44 +0000 (11:46 +1000)]
doc: rename @go_nuts to @golang

Yay!

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/14256043

11 years agocmd/go: use -installsuffix to determine the includes directory list
Dave Day [Wed, 2 Oct 2013 00:44:57 +0000 (20:44 -0400)]
cmd/go: use -installsuffix to determine the includes directory list

Currently, the directories generaed by includeArgs can have the "_race"
suffix added if invoked with -race flag, but ignores -installsuffix if
set.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/14174043

11 years agomisc/vim: Separate package and package members.
Yasuhiro Matsumoto [Tue, 1 Oct 2013 22:52:51 +0000 (08:52 +1000)]
misc/vim: Separate package and package members.
This change allow to godoc:
    :Godoc github.com/mattn/go-gtk/gtk
    :Godoc github.com/mattn/go-gtk/gtk NewWindow
    :Godoc encoding/json
    :Godoc encoding/json Marshal

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/14171043

11 years agoC: add Dave Day (Google CLA).
David Symonds [Tue, 1 Oct 2013 01:24:24 +0000 (11:24 +1000)]
C: add Dave Day (Google CLA).

R=adg, djd
CC=golang-dev
https://golang.org/cl/14176043

11 years agoundo CL 14154043 / 3e485428767e
Carl Shapiro [Mon, 30 Sep 2013 23:02:12 +0000 (16:02 -0700)]
undo CL 14154043 / 3e485428767e

««« original CL description
encoding/gob: do not hide pointer argument for the garbage collector

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14154043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/14165043

11 years agoencoding/gob: do not hide pointer argument for the garbage collector
Carl Shapiro [Mon, 30 Sep 2013 22:54:21 +0000 (15:54 -0700)]
encoding/gob: do not hide pointer argument for the garbage collector

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14154043

11 years agorace.bash, race.bat: build a race enabled cmd/cgo before trying to use it
Dave Cheney [Sun, 29 Sep 2013 00:34:41 +0000 (10:34 +1000)]
race.bash, race.bat: build a race enabled cmd/cgo before trying to use it

Fixes #5537.

To avoid `go install -v race std` replacing cmd/cgo with a race enabled version and another package trying to build a cgo enabled package, always build cmd/cgo race enabled before doing the rest of the build.

R=remyoudompheng, rsc, dvyukov, minux.ma
CC=golang-dev
https://golang.org/cl/14071044

11 years agotest: match gccgo error messages for blank1.go
Ian Lance Taylor [Sat, 28 Sep 2013 22:19:05 +0000 (15:19 -0700)]
test: match gccgo error messages for blank1.go

blank1.go:10:9: error: invalid package name _
blank1.go:17:2: error: cannot use _ as value
blank1.go:18:7: error: cannot use _ as value
blank1.go:20:8: error: invalid use of ‘_’

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14088044

11 years agotest: recognize gccgo error message in index.go
Ian Lance Taylor [Sat, 28 Sep 2013 03:38:52 +0000 (20:38 -0700)]
test: recognize gccgo error message in index.go

When a floating point constant is used as an array/slice
index, gccgo prints "error: index must be integer"; gc prints
"constant 2.1 truncated to integer".

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/14044044

11 years agosyscall: Fix one issue detected by vet.
Robin Eklind [Sat, 28 Sep 2013 01:06:50 +0000 (11:06 +1000)]
syscall: Fix one issue detected by vet.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/14038044

11 years agoencoding/json: Tweak documentation for Encoder.Encode.
Kamil Kisiel [Fri, 27 Sep 2013 05:38:39 +0000 (15:38 +1000)]
encoding/json: Tweak documentation for Encoder.Encode.

The documentation for the Encoder type calls it a stream,
not a connection.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/14015044

11 years agoreflect: expose reflect.call argument slice to the garbage collector
Carl Shapiro [Fri, 27 Sep 2013 04:59:13 +0000 (21:59 -0700)]
reflect: expose reflect.call argument slice to the garbage collector

The argument slice was kept hidden from the garbage collector
by destroying its referent in an unsafe.Pointer to uintptr
conversion.  This change preserves the unsafe.Pointer referent
and only performs an unsafe.Pointer to uintptr conversions
within expressions that construct new unsafe.Pointer values.

R=golang-dev, khr, rsc
CC=golang-dev
https://golang.org/cl/14008043

11 years agomisc/vim: "PACKAGE DOCUMENTATION" is not hilighted
Yasuhiro Matsumoto [Fri, 27 Sep 2013 02:57:09 +0000 (12:57 +1000)]
misc/vim: "PACKAGE DOCUMENTATION" is not hilighted

R=golang-dev, r, dsymonds
CC=golang-dev
https://golang.org/cl/14018043

11 years agomisc/vim: godoc is optional. so should point installation instruction.
Yasuhiro Matsumoto [Fri, 27 Sep 2013 02:35:03 +0000 (12:35 +1000)]
misc/vim: godoc is optional. so should point installation instruction.

R=golang-dev, r, dsymonds
CC=golang-dev
https://golang.org/cl/14017043

11 years agoall: fix some mistakes found by go tool vet .
Rob Pike [Fri, 27 Sep 2013 00:09:15 +0000 (10:09 +1000)]
all: fix some mistakes found by go tool vet .

R=golang-dev, iant, adg
CC=golang-dev
https://golang.org/cl/14000043

11 years agodoc: update links to spec and memory model
Andrew Gerrand [Thu, 26 Sep 2013 23:46:36 +0000 (09:46 +1000)]
doc: update links to spec and memory model

Fixes #6488.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14004043

11 years agocrypto/tls: don't select TLS 1.2 cipher suites in prior versions.
Adam Langley [Thu, 26 Sep 2013 21:09:56 +0000 (17:09 -0400)]
crypto/tls: don't select TLS 1.2 cipher suites in prior versions.

AES-GCM cipher suites are only defined for TLS 1.2, although there's
nothing really version specific about them. However, development
versions of NSS (meaning Firefox and Chrome) have an issue where
they'll advertise TLS 1.2-only cipher suites in a TLS 1.1 ClientHello
but then balk when the server selects one.

This change causes Go clients not to advertise TLS 1.2 cipher suites
unless TLS 1.2 is being used, and prevents servers from selecting them
unless TLS 1.2 has been negotiated.

https://code.google.com/p/chromium/issues/detail?id=297151
https://bugzilla.mozilla.org/show_bug.cgi?id=919677

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/13573047

11 years agoruntime, syscall: update freebsd/arm calling convention to match EABI
Dave Cheney [Thu, 26 Sep 2013 11:35:49 +0000 (21:35 +1000)]
runtime, syscall: update freebsd/arm calling convention to match EABI

Fixes #6451.

There is still some breakages unrelated to the syscall change.

[root@beaglebone ~/go/src]# /root/go/pkg/tool/freebsd_arm/go_bootstrap version
go version devel freebsd/arm
a std@beaglebone ~/go/src]# /root/go/pkg/tool/freebsd_arm/go_bootstrap install -
fatal error: mark - finalizer inconsistency

runtime stack:
runtime.throw(0x3e80ac)
        /root/go/src/pkg/runtime/panic.c:464 +0x5c
addfinroots(0x2)
        /root/go/src/pkg/runtime/mgc0.c:1501 +0x74
runtime.walkfintab(0x6c200)
        /root/go/src/pkg/runtime/mfinal.c:216 +0xa0
addroots()
        /root/go/src/pkg/runtime/mgc0.c:1561 +0x188
gc(0x50632f78)
        /root/go/src/pkg/runtime/mgc0.c:2098 +0x19c
mgc(0x306170a0)
        /root/go/src/pkg/runtime/mgc0.c:2049 +0x30
runtime.mcall(0x3e97b0)
        /root/go/src/pkg/runtime/asm_arm.s:165 +0x3c

goroutine 1 [garbage collection]:
runtime.gc(0x0)
        /root/go/src/pkg/runtime/mgc0.c:2020 +0x1a0 fp=0x50632f80
runtime.mallocgc(0x680, 0x1b1971, 0x1)
        /root/go/src/pkg/runtime/malloc.goc:143 +0x210 fp=0x50632fbc
----- stack segment boundary -----
cnew(0x1b1970, 0x640, 0x1)
        /root/go/src/pkg/runtime/malloc.goc:718 +0xc4 fp=0x50626110
runtime.cnewarray(0x1b1970, 0x640)
        /root/go/src/pkg/runtime/malloc.goc:731 +0x3c fp=0x50626120
makeslice1(0x1ac6d0, 0x500, 0x640, 0x50626190)
        /root/go/src/pkg/runtime/slice.c:57 +0x50 fp=0x5062612c
growslice1(0x1ac6d0, 0x30714a00, 0x500, 0x500, 0x501, ...)
        /root/go/src/pkg/runtime/slice.c:113 +0x8c fp=0x50626144
runtime.growslice(0x1ac6d0, 0x30714a00, 0x500, 0x500, 0x1, ...)
        /root/go/src/pkg/runtime/slice.c:80 +0x19c fp=0x50626174
go/build.(*importReader).readByte(0x3070d1b0, 0xb384e)
        /root/go/src/pkg/go/build/read.go:43 +0xbc fp=0x506261b4
go/build.(*importReader).peekByte(0x3070d1b0, 0x3070d101, 0x3070d180)
        /root/go/src/pkg/go/build/read.go:89 +0x210 fp=0x506261d0
go/build.readComments(0x203e2560, 0x306f79a8, 0x306f79a8, 0x203e2560, 0x306f79a8, ...)
        /root/go/src/pkg/go/build/read.go:194 +0x84 fp=0x506261f4
go/build.(*Context).matchFile(0x3e9730, 0x306209c0, 0x13, 0x306c42b4, 0x5, ...)
        /root/go/src/pkg/go/build/build.go:812 +0x74c fp=0x5062629c
go/build.(*Context).Import(0x3e9730, 0x1f95c8, 0x1, 0x30620960, 0x13, ...)
        /root/go/src/pkg/go/build/build.go:580 +0xd64 fp=0x506268dc
go/build.(*Context).ImportDir(0x3e9730, 0x30620960, 0x13, 0x0, 0x24d901, ...)
        /root/go/src/pkg/go/build/build.go:397 +0x5c fp=0x50626904
main.func·021(0x30620960, 0x13, 0x203e2200, 0x30680330, 0x0, ...)
        /root/go/src/cmd/go/main.go:521 +0x2cc fp=0x5062696c
path/filepath.walk(0x30620960, 0x13, 0x203e2200, 0x30680330, 0x50626ae8, ...)
        /root/go/src/pkg/path/filepath/path.go:341 +0x5c fp=0x506269d8
path/filepath.walk(0x3067e720, 0x11, 0x203e2200, 0x30680210, 0x50626ae8, ...)
        /root/go/src/pkg/path/filepath/path.go:359 +0x308 fp=0x50626a44
path/filepath.Walk(0x3067e720, 0x11, 0x50626ae8, 0x1f9728, 0x1)
        /root/go/src/pkg/path/filepath/path.go:380 +0xb4 fp=0x50626a68
main.matchPackages(0xbfffedea, 0x3, 0x1b1190, 0x3067e600, 0x10)
        /root/go/src/cmd/go/main.go:530 +0x2c0 fp=0x50626b1c
main.allPackages(0xbfffedea, 0x3, 0x1fadc8, 0x3, 0x1)
        /root/go/src/cmd/go/main.go:474 +0x34 fp=0x50626b70
main.importPathsNoDotExpansion(0x30620018, 0x1, 0x1, 0x0, 0xffffffff, ...)
        /root/go/src/cmd/go/main.go:305 +0x2f8 fp=0x50626c04
main.importPaths(0x30620018, 0x1, 0x1, 0x3, 0x0, ...)
        /root/go/src/cmd/go/main.go:315 +0x44 fp=0x50626c88
main.packagesAndErrors(0x30620018, 0x1, 0x1, 0x50626d60, 0x90f44, ...)
        /root/go/src/cmd/go/pkg.go:798 +0x1bc fp=0x50626d1c
main.packagesForBuild(0x30620018, 0x1, 0x1, 0x53490, 0x0, ...)
        /root/go/src/cmd/go/pkg.go:818 +0x44 fp=0x50626dac
main.runInstall(0x3e46e0, 0x30620018, 0x1, 0x1)
        /root/go/src/cmd/go/build.go:311 +0x48 fp=0x50626e60
main.main()
        /root/go/src/cmd/go/main.go:161 +0x518 fp=0x50626f8c
runtime.main()
        /root/go/src/pkg/runtime/proc.c:222 +0x100 fp=0x50626fc0
runtime.goexit()
        /root/go/src/pkg/runtime/proc.c:1396 fp=0x50626fc0

goroutine 3 [syscall]:
os/signal.loop()
        /root/go/src/pkg/os/signal/signal_unix.go:21 +0x24
created by os/signal.init·1
        /root/go/src/pkg/os/signal/signal_unix.go:27 +0x48

R=minux.ma, rsc
CC=golang-dev
https://golang.org/cl/13824044

11 years agocmd/go: "go test -c -test.bench=XX fmt" shouldn't hang
Shenghou Ma [Wed, 25 Sep 2013 20:18:33 +0000 (16:18 -0400)]
cmd/go: "go test -c -test.bench=XX fmt" shouldn't hang
Fixes #6480.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/13925043

11 years agodoc: mention the install locations for godoc, cover, and vet
Andrew Gerrand [Wed, 25 Sep 2013 08:15:29 +0000 (18:15 +1000)]
doc: mention the install locations for godoc, cover, and vet

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13893043

11 years agodoc/go1.2.html: add go/ast.SliceExpr.Slice3
Rob Pike [Wed, 25 Sep 2013 06:17:54 +0000 (16:17 +1000)]
doc/go1.2.html: add go/ast.SliceExpr.Slice3

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13877044

11 years agodoc: fix typo in install-source.html
Andrew Gerrand [Wed, 25 Sep 2013 04:27:23 +0000 (14:27 +1000)]
doc: fix typo in install-source.html

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/13892043

11 years agodoc: document installation of go.tools commands
Andrew Gerrand [Wed, 25 Sep 2013 04:10:49 +0000 (14:10 +1000)]
doc: document installation of go.tools commands

Fixes #5663.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13891043

11 years agocmd/cgo: fix so that tests pass again when using gccgo
Ian Lance Taylor [Wed, 25 Sep 2013 01:11:13 +0000 (18:11 -0700)]
cmd/cgo: fix so that tests pass again when using gccgo

Use the symbol prefixes with the prologue functions when using
gccgo.

Use an & when referring to a function declared as a variable.

Fix the malloc prologue function.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/13878043

11 years agohtml/template: update the Tree field after parsing new templates
Rob Pike [Wed, 25 Sep 2013 00:00:09 +0000 (10:00 +1000)]
html/template: update the Tree field after parsing new templates
After text/template.Parse, all the templates may have changed, so
we need to set them all back to their unescaped state. The code
did this but (mea culpa) forgot to set the Tree field of the html/template
struct.

Since the Tree is reset during escaping, this only matters if an error
arises during escaping and we want to print a message.

Fixes #6459.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/13877043

11 years agogo/ast: add Slice3 field to SliceExpr
Robert Griesemer [Tue, 24 Sep 2013 23:35:35 +0000 (16:35 -0700)]
go/ast: add Slice3 field to SliceExpr

If Slice3 is set, the expression is
a 3-index slice expression (2 colons).
Required for type-checking.

Backward-compatible API extension.

R=r, rsc
CC=golang-dev
https://golang.org/cl/13826050