]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agobuiltin: document true and false.
Robert Griesemer [Thu, 18 Apr 2013 21:36:08 +0000 (14:36 -0700)]
builtin: document true and false.

Fixes #5315.

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

12 years agodoc: misc tweaks, new links, fix broken links
Brad Fitzpatrick [Thu, 18 Apr 2013 19:43:23 +0000 (12:43 -0700)]
doc: misc tweaks, new links, fix broken links

I read docs and wrote a crawler + link checker on the plane,
which also checks for #fragments. I'll send that out later
when it's less gross.

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

12 years agomisc/dashboard/builder: always do a native build
Dave Cheney [Thu, 18 Apr 2013 06:42:56 +0000 (16:42 +1000)]
misc/dashboard/builder: always do a native build

https://golang.org/cl/8134043 disabled cgo when cross compiling, this means builders which compile for both amd64 and 386 will be compiling the latter with cgo disabled.

This proposal modifies the builder to mirror the dist tool by always doing a native build.

Tested on my darwin/amd64 builder and confirmed the result when building darwin/386 is a native 386 build with cgo enabled.

R=bradfitz, dsymonds, r, adg
CC=golang-dev
https://golang.org/cl/8842044

12 years agocrypto/rand: better panic message for invalid Int argument.
Rémy Oudompheng [Thu, 18 Apr 2013 06:21:15 +0000 (23:21 -0700)]
crypto/rand: better panic message for invalid Int argument.

Also document the panic to be consistent with math/rand.

Fixes #5187.

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

12 years agomime/multipart: don't strip leading space/tab in quoted-printable decoding
Brad Fitzpatrick [Thu, 18 Apr 2013 03:04:58 +0000 (20:04 -0700)]
mime/multipart: don't strip leading space/tab in quoted-printable decoding

Late bug fix, but this is arguably a regression from Go 1.0,
since we added this transparent decoding since then. Without
this fix, Go 1.0 users could decode this correctly, but Go 1.1
users would not be able to.

The newly added test is from the RFC itself.

The updated tests had the wrong "want" values before. They
were there to test \r\n vs \n equivalence (which is
unchanged), not leading whitespace.

The skipWhite decoder struct field was added in the battles of
Issue 4771 in revision b3bb265bfecf. It was just a wrong
strategy, from an earlier round of attempts in
https://golang.org/cl/7300092/

Update #4771
Fixes #5295

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

12 years agomisc/dashboard/builder: include $USER in build environment.
David Symonds [Thu, 18 Apr 2013 01:04:20 +0000 (11:04 +1000)]
misc/dashboard/builder: include $USER in build environment.

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

12 years agodoc/go1.1.html, mime/multipart: document quoted-printable decoding
Brad Fitzpatrick [Wed, 17 Apr 2013 20:25:28 +0000 (13:25 -0700)]
doc/go1.1.html, mime/multipart: document quoted-printable decoding

Fixes #5293

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

12 years agoarchive/zip: add docs on type of slashes in paths
Brad Fitzpatrick [Wed, 17 Apr 2013 20:25:12 +0000 (13:25 -0700)]
archive/zip: add docs on type of slashes in paths

Fixes #5307

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

12 years agogo/token: fix grammar for precedence consts
Alexei Sholik [Wed, 17 Apr 2013 18:46:30 +0000 (11:46 -0700)]
go/token: fix grammar for precedence consts

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

12 years agomisc/cgo/test: fix a gcc warning
Shenghou Ma [Wed, 17 Apr 2013 18:33:55 +0000 (02:33 +0800)]
misc/cgo/test: fix a gcc warning
See https://code.google.com/p/go/issues/detail?id=5227#c16.

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

12 years agodoc: more doubled words
Rob Pike [Tue, 16 Apr 2013 21:20:06 +0000 (14:20 -0700)]
doc: more doubled words
I wrote a tool.

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

12 years agodoc/effective_go: another doubled word
Rob Pike [Tue, 16 Apr 2013 20:59:10 +0000 (13:59 -0700)]
doc/effective_go: another doubled word
It's clear that that should never happen.

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

12 years agodoc/effective_go.html: fix typo
Shenghou Ma [Tue, 16 Apr 2013 20:41:28 +0000 (04:41 +0800)]
doc/effective_go.html: fix typo
Fixes #5296.

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

12 years agocmd/dist, make.bash: pass -mmacosx-version-min=10.6 to gcc on Darwin
Shenghou Ma [Tue, 16 Apr 2013 20:30:52 +0000 (13:30 -0700)]
cmd/dist, make.bash: pass -mmacosx-version-min=10.6 to gcc on Darwin
Fixes #5261.

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

12 years agoruntime: if span was scavenged, mark it as needing to be zeroed
Ian Lance Taylor [Tue, 16 Apr 2013 16:08:06 +0000 (09:08 -0700)]
runtime: if span was scavenged, mark it as needing to be zeroed

Update #4979.

R=dvyukov, r, bradfitz
CC=golang-dev
https://golang.org/cl/8697045

12 years agodatabase/sql: close driver Stmt before releasing Conn
Brad Fitzpatrick [Mon, 15 Apr 2013 21:06:41 +0000 (14:06 -0700)]
database/sql: close driver Stmt before releasing Conn

From the issue, which describes it as well as I could:

database/sql assumes that driver.Stmt.Close does not need the
connection.

see database/sql/sql.go:1308:

This puts the Rows' connection back into the idle pool, and
then calls the driver.Stmt.Close method of the Stmt it belongs
to.  In the postgresql driver implementation
(https://github.com/lib/pq), Stmt.Close communicates with the
server (on the connection that was just put back into the idle
pool).  Most of the time, this causes no problems, but if
another goroutine makes a query at the right (wrong?) time,
chaos results.

In any case, traffic is being sent on "free" connections
shortly after they are freed, leading to race conditions that
kill the driver code.

Fixes #5283

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

12 years agodoc/reference.html: update list of sub-repositories.
Shenghou Ma [Mon, 15 Apr 2013 20:31:25 +0000 (04:31 +0800)]
doc/reference.html: update list of sub-repositories.

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

12 years agonet/http/cookiejar: mention go.net/publicsuffix.
Shenghou Ma [Mon, 15 Apr 2013 20:29:55 +0000 (04:29 +0800)]
net/http/cookiejar: mention go.net/publicsuffix.

R=golang-dev, r, gary.burd, dr.volker.dobler
CC=golang-dev
https://golang.org/cl/8660046

12 years agotest/stress: start of a runtime stress program
Brad Fitzpatrick [Mon, 15 Apr 2013 18:50:14 +0000 (11:50 -0700)]
test/stress: start of a runtime stress program

Runs forever, stressing the runtime in various ways.

It should never terminate.

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

12 years agocmd/ld: ignore PE sections that are not code or data
Ian Lance Taylor [Mon, 15 Apr 2013 17:35:37 +0000 (10:35 -0700)]
cmd/ld: ignore PE sections that are not code or data

Update #5106
Update #5273

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

12 years agoruntime: fix build on openbsd/386
Joel Sing [Mon, 15 Apr 2013 17:20:24 +0000 (10:20 -0700)]
runtime: fix build on openbsd/386

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

12 years agocrypto/ecdsa: doc cleanup
Brad Fitzpatrick [Sun, 14 Apr 2013 06:09:08 +0000 (23:09 -0700)]
crypto/ecdsa: doc cleanup

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

12 years agodoc: fix typo
Stefan Nilsson [Sat, 13 Apr 2013 23:22:57 +0000 (09:22 +1000)]
doc: fix typo

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

12 years agocmd/gc: disable inlining of method values
Daniel Morsing [Sat, 13 Apr 2013 06:22:16 +0000 (08:22 +0200)]
cmd/gc: disable inlining of method values

They caused internal compiler errors and they're expensive enough that inlining them doesn't make sense.

Fixes #5259.

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

12 years agogo/scanner: reject BOMs that are not at the beginning
Robert Griesemer [Sat, 13 Apr 2013 04:28:38 +0000 (21:28 -0700)]
go/scanner: reject BOMs that are not at the beginning

For compliance with gc. See also issue 5265.
Not Go1.1 critical, but harmless.

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

12 years agotesting/iotest: rephrase DataErrReader's description
Alexei Sholik [Fri, 12 Apr 2013 23:08:56 +0000 (16:08 -0700)]
testing/iotest: rephrase DataErrReader's description

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

12 years agotest: make goprint.go wait longer for go its routine to execute
Carl Shapiro [Fri, 12 Apr 2013 23:04:19 +0000 (16:04 -0700)]
test: make goprint.go wait longer for go its routine to execute

Update #5281

R=golang-dev, r, bradfitz, cshapiro
CC=golang-dev
https://golang.org/cl/8631047

12 years agotest: raise the allocation threshold for chan/select2.go failure
Carl Shapiro [Fri, 12 Apr 2013 22:58:34 +0000 (15:58 -0700)]
test: raise the allocation threshold for chan/select2.go failure

Updates #5282

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

12 years agocmd/go: quote command line arguments in debug output
Volker Dobler [Fri, 12 Apr 2013 21:05:14 +0000 (14:05 -0700)]
cmd/go: quote command line arguments in debug output

Debug output from go test -x may contain empty arguments.
This CL quotes arguments if needed. E.g. the output of
go test -x is now
  .../6g -o ./_go_.6 -p testmain -complete -D "" -I . -I $WORK ./_testmain.go
which is easier to grasp.

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

12 years agocmd/go: quote command line arguments in debug output
Volker Dobler [Fri, 12 Apr 2013 21:04:00 +0000 (14:04 -0700)]
cmd/go: quote command line arguments in debug output

Debug output from go test -x may contain empty arguments.
This CL quotes arguments if needed. E.g. the output of
go test -x is now
  .../6g -o ./_go_.6 -p testmain -complete -D "" -I . -I $WORK ./_testmain.go
which is easier to grasp.

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

12 years agocmd/ld: always do external link for -linkmode=external
Ian Lance Taylor [Fri, 12 Apr 2013 20:21:17 +0000 (13:21 -0700)]
cmd/ld: always do external link for -linkmode=external

There are tests in run.bash for -linkmode=external.

Fixes #5238.

R=golang-dev, bradfitz, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/8716044

12 years agocmd/ld: if we fail from an unexpected PE flags value, print it
Ian Lance Taylor [Fri, 12 Apr 2013 14:58:50 +0000 (07:58 -0700)]
cmd/ld: if we fail from an unexpected PE flags value, print it

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

12 years agoruntime: add a hook to disable precise GC
Ian Lance Taylor [Fri, 12 Apr 2013 12:23:38 +0000 (05:23 -0700)]
runtime: add a hook to disable precise GC

This will let us ask people to rebuild the Go system without
precise GC, and then rebuild and retest their program, to see
if precise GC is causing whatever problem they are having.

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

12 years agoruntime: use UMTX_OP_WAIT_UINT on FreeBSD
Ian Lance Taylor [Fri, 12 Apr 2013 12:20:15 +0000 (05:20 -0700)]
runtime: use UMTX_OP_WAIT_UINT on FreeBSD

UMTX_OP_WAIT expects that the address points to a uintptr, but
the code in lock_futex.c uses a uint32.  UMTX_OP_WAIT_UINT is
just like UMTX_OP_WAIT, but the address points to a uint32.
This almost certainly makes no difference on a little-endian
system, but since the kernel supports it we should do the
right thing.  And, who knows, maybe it matters.

R=golang-dev, bradfitz, r, ality
CC=golang-dev
https://golang.org/cl/8699043

12 years agomisc/dist/darwin: add execute bit to preinstall
Rob Pike [Thu, 11 Apr 2013 20:40:14 +0000 (13:40 -0700)]
misc/dist/darwin: add execute bit to preinstall
Fixes #5258.

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

12 years agoencoding/json: documentation regarding anonymous fields.
Rob Pike [Thu, 11 Apr 2013 19:46:23 +0000 (12:46 -0700)]
encoding/json: documentation regarding anonymous fields.

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

12 years agogc: escape unicode BOM in exported string literals
Volker Dobler [Thu, 11 Apr 2013 18:45:18 +0000 (11:45 -0700)]
gc: escape unicode BOM in exported string literals

Fixes #5260.

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

12 years agospec: add another sentence about BOMs
Rob Pike [Thu, 11 Apr 2013 18:33:25 +0000 (11:33 -0700)]
spec: add another sentence about BOMs
Although one may argue that they should be legal, gc (at least)
disallows byte order marks that are not the first code point
in the file. Added a sentence to the "Implementation restriction"
clause in the "Source code representation" section to document
this better.

Lifting this restriction (again - the rule has changed at least
twice already) would not break any existing programs, should
we later decide yet again to fiddle the rules about these little
fly specks.

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

12 years ago cmd/cgo, cmd/go: remove #cgo directive parsing from cmd/cgo
Andrew Wilkins [Thu, 11 Apr 2013 04:41:54 +0000 (21:41 -0700)]
cmd/cgo, cmd/go: remove #cgo directive parsing from cmd/cgo

This change removes processing of #cgo directives from cmd/cgo,
pushing the onus back on cmd/go to pass all necessary flags.

Fixes #5224. See comments for rationale.

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

12 years agobufio/Scan: fix error handling at EOF
Rob Pike [Thu, 11 Apr 2013 03:58:19 +0000 (20:58 -0700)]
bufio/Scan: fix error handling at EOF
Fixes #5268.

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

12 years agocmd/ld: fix scope of static objects in symbol table
Anthony Martin [Thu, 11 Apr 2013 01:47:58 +0000 (18:47 -0700)]
cmd/ld: fix scope of static objects in symbol table

All symbols are currently marked with global scope.
The correct behavior was lost when the symbol table
format was changed.

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

12 years agofmt: tweak the explanation of Stringer to be more correct and less specific
Rob Pike [Wed, 10 Apr 2013 21:05:34 +0000 (14:05 -0700)]
fmt: tweak the explanation of Stringer to be more correct and less specific
The String method is called whenever the printing operation wants a string,
not just for %s and %v.

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

12 years agogo/ast: distinguish between methods and functions in filtering
Robert Griesemer [Wed, 10 Apr 2013 20:39:20 +0000 (13:39 -0700)]
go/ast: distinguish between methods and functions in filtering

Go1.1 harmless, but not critical.

Fixes #5249.

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

12 years agoencoding/json: different decision on tags and shadowing
Rob Pike [Wed, 10 Apr 2013 20:05:34 +0000 (13:05 -0700)]
encoding/json: different decision on tags and shadowing
If there are no tags, the rules are the same as before.
If there is a tagged field, choose it if there is exactly one
at the top level of all fields.
More tests. The old tests were clearly inadequate, since
they all pass as is. The new tests only work with the new code.

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

12 years agocmd/ld: fix argument passing in doc.go
Shenghou Ma [Wed, 10 Apr 2013 20:04:02 +0000 (04:04 +0800)]
cmd/ld: fix argument passing in doc.go

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

12 years agocmd/ld: fix inconsistency in internal linking of common symbols.
Rémy Oudompheng [Wed, 10 Apr 2013 05:15:49 +0000 (07:15 +0200)]
cmd/ld: fix inconsistency in internal linking of common symbols.

Some variables declared in C could end up as undefined symbols
in the final binary and have null address.

Fixes #5114.
Fixes #5227.

R=golang-dev, iant, ajstarks, dave, r
CC=golang-dev
https://golang.org/cl/8602044

12 years agoencoding/json: fix handling of anonymous fields
Rob Pike [Tue, 9 Apr 2013 22:00:21 +0000 (15:00 -0700)]
encoding/json: fix handling of anonymous fields
The old code was incorrect and also broken. It passed the tests by accident.
The new algorithm is:
        1) Sort the fields in order of names.
        2) For all fields with the same name, sort in increasing depth.
        3) Choose the single field with shortest depth.
If any of the fields of a given name has a tag, do the above using
tagged fields of that name only.
Fixes #5245.

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

12 years agoio: document non-guarantees of io.Closer
Brad Fitzpatrick [Tue, 9 Apr 2013 17:17:35 +0000 (10:17 -0700)]
io: document non-guarantees of io.Closer

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

12 years agolib9: add newline to exec error message
Ian Lance Taylor [Tue, 9 Apr 2013 17:03:14 +0000 (10:03 -0700)]
lib9: add newline to exec error message

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

12 years agodist: add .exe extension to tour.exe
Andrew Gerrand [Tue, 9 Apr 2013 08:17:55 +0000 (18:17 +1000)]
dist: add .exe extension to tour.exe

Fixes #5246.

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

12 years agodist: include js directory in misc/tour in binary distros
Andrew Gerrand [Tue, 9 Apr 2013 07:51:55 +0000 (17:51 +1000)]
dist: include js directory in misc/tour in binary distros

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

12 years agonet: fix possible runtime.PollDesc leak when connect or listen fails
Mikio Hara [Tue, 9 Apr 2013 03:41:58 +0000 (12:41 +0900)]
net: fix possible runtime.PollDesc leak when connect or listen fails

Makes it possible to return the spent runtime.PollDesc to
runtime.pollcache descriptor pool when netFD.connect or
syscall.Listen fails.

Fixes #5219.

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

12 years agoA+C: Nicholas Presta (individual CLA)
Andrew Gerrand [Tue, 9 Apr 2013 03:12:31 +0000 (13:12 +1000)]
A+C: Nicholas Presta (individual CLA)

Generated by addca.

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

12 years agorun.bat: make windows runtime test timeout same as other os
Alex Brainman [Tue, 9 Apr 2013 03:01:09 +0000 (13:01 +1000)]
run.bat: make windows runtime test timeout same as other os

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

12 years agomisc/dashboard/builder: add -race builder support
Dave Cheney [Tue, 9 Apr 2013 02:48:04 +0000 (12:48 +1000)]
misc/dashboard/builder: add -race builder support

If the build key contains -race, the builder will invoke to the race.{bat,bash} build command. This allows {darwin,linux,windows}-amd64 builders to do race and non race builds in sequence.

R=adg, dvyukov, fullung
CC=golang-dev
https://golang.org/cl/8266046

12 years agoruntime: fix integer overflow in hashmap
Dmitriy Vyukov [Tue, 9 Apr 2013 01:56:38 +0000 (18:56 -0700)]
runtime: fix integer overflow in hashmap
The test is problematic, because it requires 8GB+ of RAM.
Fixes #5239.

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

12 years agonet: add test for runtime.PollDesc leak
Dave Cheney [Tue, 9 Apr 2013 01:14:22 +0000 (11:14 +1000)]
net: add test for runtime.PollDesc leak

See 8318044

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

12 years agocmd/cgo: record CGO_LDFLAGS env var in _cgo_flags
Andrew Wilkins [Mon, 8 Apr 2013 23:35:06 +0000 (07:35 +0800)]
cmd/cgo: record CGO_LDFLAGS env var in _cgo_flags

cgo stores cgo LDFLAGS in _cgo_flags and _cgo_defun.c.
The _cgo_defun.c records the flags via
"#pragma cgo_ldflag <flag>", which external linking
relies upon for passing libraries (and search paths)
to the host linker.

The go command will allow LDFLAGS for cgo to be passed
through the environment (CGO_LDFLAGS); cgo ignores
this environment variable, and so its value doesn't
make it into the above mentioned files. This CL changes
cgo to record CGO_LDFLAGS also.

Fixes #5205.

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

12 years agosync, sync/atomic: do not corrupt race detector after a nil dereference.
Rémy Oudompheng [Mon, 8 Apr 2013 21:46:54 +0000 (23:46 +0200)]
sync, sync/atomic: do not corrupt race detector after a nil dereference.

The race detector uses a global lock to analyze atomic
operations. A panic in the middle of the code leaves the
lock acquired.

Similarly, the sync package may leave the race detectro
inconsistent when methods are called on nil pointers.

R=golang-dev, r, minux.ma, dvyukov, rsc, adg
CC=golang-dev
https://golang.org/cl/7981043

12 years agoruntime: poor man's heap type info checker
Dmitriy Vyukov [Mon, 8 Apr 2013 20:36:35 +0000 (13:36 -0700)]
runtime: poor man's heap type info checker
It's not trivial to make a comprehensive check
due to inferior pointers, reflect, gob, etc.
But this is essentially what I've used to debug
the GC issues.
Update #5193.

R=golang-dev, iant, 0xe2.0x9a.0x9b, r
CC=golang-dev
https://golang.org/cl/8455043

12 years agotest: fix mapnan.go build tag
Brad Fitzpatrick [Mon, 8 Apr 2013 07:09:35 +0000 (00:09 -0700)]
test: fix mapnan.go build tag

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

12 years agocmd/gc: properly set variadic flag on method values.
Rémy Oudompheng [Mon, 8 Apr 2013 06:59:33 +0000 (08:59 +0200)]
cmd/gc: properly set variadic flag on method values.

Fixes #5231.

R=golang-dev, daniel.morsing, adg
CC=golang-dev
https://golang.org/cl/8275044

12 years agocmd/go: fix a misleading sentence
Rob Pike [Mon, 8 Apr 2013 06:27:26 +0000 (23:27 -0700)]
cmd/go: fix a misleading sentence
Apologies for not reviewing the previous CL; I was on the road.
The text was misleading; execution is no more separate than with
any other test. Rewritten. Dropped the odd adverb.

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

12 years agocmd/go: clarify what "pkg.test" means wrt the -c flag
Andrew Gerrand [Mon, 8 Apr 2013 06:03:19 +0000 (16:03 +1000)]
cmd/go: clarify what "pkg.test" means wrt the -c flag

Fixes #5230.

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

12 years agoarchive/zip: handle trailing data after the end of directory header
Andrew Gerrand [Mon, 8 Apr 2013 05:38:06 +0000 (15:38 +1000)]
archive/zip: handle trailing data after the end of directory header

The spec doesn't explicitly say that trailing data is okay, but a lot
of people do this and most unzippers will handle it just fine. In any
case, this makes the package more useful, and led me to make the
directory parsing code marginally more robust.

Fixes #5228.

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

12 years agocmd/go: document usage of external test packages
Kamil Kisiel [Mon, 8 Apr 2013 04:42:06 +0000 (14:42 +1000)]
cmd/go: document usage of external test packages

Fixes #5144

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

12 years agodoc: fix typos in go1.1.html
Jonathan Rudenberg [Mon, 8 Apr 2013 02:04:50 +0000 (12:04 +1000)]
doc: fix typos in go1.1.html

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

12 years agoreflect: document the unreliability of StringHeader and SliceHeader
Rob Pike [Mon, 8 Apr 2013 01:42:47 +0000 (18:42 -0700)]
reflect: document the unreliability of StringHeader and SliceHeader

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

12 years agodoc: document go1.1 build tag
Andrew Gerrand [Mon, 8 Apr 2013 01:41:01 +0000 (11:41 +1000)]
doc: document go1.1 build tag

Fixes #5235.

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

12 years agoruntime: fix race on hashmap flags field
Dmitriy Vyukov [Mon, 8 Apr 2013 01:19:16 +0000 (18:19 -0700)]
runtime: fix race on hashmap flags field
Use atomic operations on flags field to make sure we aren't
losing a flag update during parallel map operations.

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

12 years agogo/ast: fix typo in Fprint documentation
Alexei Sholik [Sun, 7 Apr 2013 23:50:23 +0000 (16:50 -0700)]
go/ast: fix typo in Fprint documentation

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

12 years agoundo CL 8363045 / a3ce42f9748b
David Symonds [Sun, 7 Apr 2013 21:59:47 +0000 (07:59 +1000)]
undo CL 8363045 / a3ce42f9748b

It changes an exported API, and breaks the build.

««« original CL description
reflect: use unsafe.Pointer in StringHeader and SliceHeader

Relates to issue 5193.

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

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

12 years agoreflect: use unsafe.Pointer in StringHeader and SliceHeader
Jan Ziak [Sun, 7 Apr 2013 21:33:40 +0000 (23:33 +0200)]
reflect: use unsafe.Pointer in StringHeader and SliceHeader

Relates to issue 5193.

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

12 years agotest: fix flaky NaN-key map complexity test
Brad Fitzpatrick [Sun, 7 Apr 2013 18:56:15 +0000 (11:56 -0700)]
test: fix flaky NaN-key map complexity test

Don't measure wall time in map.go. Keep it portable
and only test NaN, but not time.

Move time tests to mapnan.go and only measure user CPU time,
not wall time. It builds on Darwin and Linux, the primary
platforms where people hack on the runtime & in particular
maps. The runtime is shared, though, so we don't need it to
run on all of the platforms.

Fixes flaky build failures like:
http://build.golang.org/log/ba67eceefdeaa1142cb6c990a62fa3ffd8fd73f8

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

12 years agoruntime, runtime/debug, runtime/race: deflake tests
Albert Strasheim [Sun, 7 Apr 2013 18:37:37 +0000 (11:37 -0700)]
runtime, runtime/debug, runtime/race: deflake tests

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

12 years agolib9: handle empty TMPDIR more gracefully.
Albert Strasheim [Sun, 7 Apr 2013 18:16:15 +0000 (11:16 -0700)]
lib9: handle empty TMPDIR more gracefully.

Before, an empty TMPDIR would lead to:
cannot create <nil>/go.o: No such file or directory

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

12 years agoruntime: gofmt -s
Albert Strasheim [Sun, 7 Apr 2013 08:37:32 +0000 (18:37 +1000)]
runtime: gofmt -s

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

12 years agoruntime: fix deadlock in network poller
Dmitriy Vyukov [Sun, 7 Apr 2013 05:27:54 +0000 (22:27 -0700)]
runtime: fix deadlock in network poller
The invariant is that there must be at least one running P or a thread polling network.
It was broken.
Fixes #5216.

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

12 years agoruntime: make CgoMal alloc field void*
Ian Lance Taylor [Sun, 7 Apr 2013 03:18:15 +0000 (20:18 -0700)]
runtime: make CgoMal alloc field void*

This makes it an unsafe.Pointer in Go so the garbage collector
will treat it as a pointer to untyped data, not a pointer to
bytes.

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/8286045

12 years agoruntime: change Note from union to struct
Dmitriy Vyukov [Sun, 7 Apr 2013 03:09:02 +0000 (20:09 -0700)]
runtime: change Note from union to struct
Unions can break precise GC.
Update #5193.

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

12 years agoruntime: change Lock from union to struct
Dmitriy Vyukov [Sun, 7 Apr 2013 03:07:07 +0000 (20:07 -0700)]
runtime: change Lock from union to struct
Unions can break precise GC.
Update #5193.

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

12 years agoruntime: replace unions with structs
Dmitriy Vyukov [Sun, 7 Apr 2013 03:02:49 +0000 (20:02 -0700)]
runtime: replace unions with structs
Unions can break precise GC.
Update #5193.

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

12 years agoruntime: replace union in MHeap with a struct
Dmitriy Vyukov [Sun, 7 Apr 2013 03:02:03 +0000 (20:02 -0700)]
runtime: replace union in MHeap with a struct
Unions break precise GC.
Update #5193.

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

12 years agoruntime: reset dangling typed pointer
Dmitriy Vyukov [Sun, 7 Apr 2013 03:01:28 +0000 (20:01 -0700)]
runtime: reset dangling typed pointer
+untype it because it can point to different types
Update #5193.

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

12 years agoruntime: reset typed dangling pointer
Dmitriy Vyukov [Sun, 7 Apr 2013 03:00:45 +0000 (20:00 -0700)]
runtime: reset typed dangling pointer
If for whatever reason seh points into Go heap region,
the dangling pointer will cause memory corruption during GC.
Update #5193.

R=golang-dev, alex.brainman, iant
CC=golang-dev
https://golang.org/cl/8402045

12 years agomisc: update zsh completion
Jonathan Rudenberg [Sat, 6 Apr 2013 20:11:12 +0000 (04:11 +0800)]
misc: update zsh completion

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

12 years agocmd/go: fix capitalization of Bitbucket, document Git support
John Howard Palevich [Sat, 6 Apr 2013 20:06:11 +0000 (04:06 +0800)]
cmd/go: fix capitalization of Bitbucket, document Git support

Fixes #5226.

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

12 years agoA+C: John Howard Palevich (individual CLA)
Ian Lance Taylor [Sat, 6 Apr 2013 14:13:31 +0000 (07:13 -0700)]
A+C: John Howard Palevich (individual CLA)

Generated by addca.

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

12 years agonet/http: fix typo in ErrMissingBoundary
Jonathan Rudenberg [Fri, 5 Apr 2013 22:23:03 +0000 (15:23 -0700)]
net/http: fix typo in ErrMissingBoundary

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

12 years agocmd/gc: fix Offsetof computation.
Rémy Oudompheng [Fri, 5 Apr 2013 19:24:07 +0000 (21:24 +0200)]
cmd/gc: fix Offsetof computation.

The offset of an embedded field s.X must be relative to s
and not to the implicit s.Field of which X is a direct field.
Moreover, no indirections may happen on the path.

Fixes #4909.

R=nigeltao, ality, daniel.morsing, iant, gri, r
CC=golang-dev
https://golang.org/cl/8287043

12 years agotesting: structure package documentation
Volker Dobler [Fri, 5 Apr 2013 02:43:18 +0000 (13:43 +1100)]
testing: structure package documentation

Makes finding the relevant information much easier.

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

12 years agostrconv: remove some test TODOs and adjust malloc limits lower
Brad Fitzpatrick [Fri, 5 Apr 2013 00:04:18 +0000 (17:04 -0700)]
strconv: remove some test TODOs and adjust malloc limits lower

These no longer allocate.

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

12 years agoruntime: use a distinct pattern to mark free blocks in need of zeroing
Carl Shapiro [Thu, 4 Apr 2013 21:18:52 +0000 (14:18 -0700)]
runtime: use a distinct pattern to mark free blocks in need of zeroing

R=golang-dev, dvyukov, khr, cshapiro
CC=golang-dev
https://golang.org/cl/8392043

12 years agogodoc: enable visibility of element linked from URL hash
Kamil Kisiel [Thu, 4 Apr 2013 21:04:02 +0000 (08:04 +1100)]
godoc: enable visibility of element linked from URL hash

Expands the example when visiting a URL such as
http://golang.org/pkg/net/http/#example_Hijacker

Fixes #5212.

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

12 years agonet/http: remove some obsolete TODOs
Brad Fitzpatrick [Thu, 4 Apr 2013 20:40:26 +0000 (13:40 -0700)]
net/http: remove some obsolete TODOs

We've decided to leave logging to third-parties (there are too
many formats), which others have done.

And we can't change the behavior of the various response
fields at this point anyway. Plus I argue they're correct and
match their documention.

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

12 years agonet/http: better stand-alone FileServer doc example
Brad Fitzpatrick [Thu, 4 Apr 2013 20:40:15 +0000 (13:40 -0700)]
net/http: better stand-alone FileServer doc example

Motivated by a deletion in the wiki, which had a better
example.

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

12 years agocmd/gc: fix a typo
Carl Shapiro [Thu, 4 Apr 2013 18:42:01 +0000 (11:42 -0700)]
cmd/gc: fix a typo

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

12 years agodoc/code.html: fix typos
Andriy Lytvynov [Thu, 4 Apr 2013 18:11:54 +0000 (11:11 -0700)]
doc/code.html: fix typos

Fixed example program's output to match program's code.
Fixes #5204.

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

12 years agoA+C: Andriy Lytvynov (individual CLA)
Rob Pike [Thu, 4 Apr 2013 18:11:45 +0000 (11:11 -0700)]
A+C: Andriy Lytvynov (individual CLA)

Generated by addca.

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

12 years agodoc: use the already defined GOPATH in PATH
Duncan Holm [Thu, 4 Apr 2013 05:36:10 +0000 (16:36 +1100)]
doc: use the already defined GOPATH in PATH

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