]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agocmd/go: undo CL 8119049
Russ Cox [Tue, 30 Apr 2013 21:04:58 +0000 (17:04 -0400)]
cmd/go: undo CL 8119049

Manual undo due to later changes in doc/go1.1.html; cmd/go/test.bash still passes.

Rationale, from CL 8119049 review log:

This makes the 'go run' command different from every other command.
For example, 'go test' does not mean 'go test *.go'.

If we were going to handle the no arguments case in 'go run', I would hope that
it would scan the current directory to find a package just like 'go build' or
'go test' would, and then it would require that package to be 'package main',
and then it would run that package. This would make it match 'go test' and 'go
build' and 'go install' and so on. It would mean that if you are working on a
command in a directory that is 'go install'able, then 'go run' will run the
binary for you. The current CL does not accomplish that when build constraints
or file name constraints are involved.

For example, if I am working on a program like:

$ ls
main.go
main_386.s
main_arm.s
main_amd64.s
$

Then 'go run' will fail here because the .s files are ignored.

If instead I am working on a program like:

$ ls
main.go
main_386.go
main_arm.go
main_amd64.go
$

then 'go run' will fail because too many files are included.

I would like to see this command implemented so that it is compatible with the
other go subcommands. Since it is too late to do that for Go 1.1, I would like
to see this CL reverted, to preserve the option to do it better later.

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

12 years agocmd/ld: emit relocs for DWARF info when doing an external link
Ian Lance Taylor [Tue, 30 Apr 2013 21:01:05 +0000 (14:01 -0700)]
cmd/ld: emit relocs for DWARF info when doing an external link

I would like opinions on whether this is a good idea for 1.1.
On the one hand it's a moderately important issue.  On the
other hand this introduces at least the possibility of
external linker errors due to the additional relocations and
it may be better to wait.

I'm fairly confident that the behaviour is unchanged when not
using an external linker.

Update #5221

This CL is tested lightly on 386 and amd64 and fixes the cases
I tested.  I have not tested it on Darwin or Windows.

R=golang-dev, dave, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/8858047

12 years agoos/exec: disable TestExtraFilesFDShuffle
Rob Pike [Tue, 30 Apr 2013 20:17:37 +0000 (13:17 -0700)]
os/exec: disable TestExtraFilesFDShuffle
It's too hard to make portable just now.

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

12 years agosyscall: fix a bug in the shuffling of file descriptors in StartProcess on Linux.
Cosmos Nicolaou [Tue, 30 Apr 2013 18:52:23 +0000 (11:52 -0700)]
syscall: fix a bug in the shuffling of file descriptors in StartProcess on Linux.

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

12 years agosyscall: fix exec_bsd.go to accompany exec_linux.go changes
Rob Pike [Tue, 30 Apr 2013 18:52:15 +0000 (11:52 -0700)]
syscall: fix exec_bsd.go to accompany exec_linux.go changes
exec_plan9.go too.
Those are in CL 8334044

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

12 years agocmd/ld: another attempt at the relocation overflow fix
Rob Pike [Tue, 30 Apr 2013 16:49:36 +0000 (09:49 -0700)]
cmd/ld: another attempt at the relocation overflow fix

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

12 years agocmd/ld: fix check for address wrap in relocation
Rob Pike [Tue, 30 Apr 2013 16:10:10 +0000 (09:10 -0700)]
cmd/ld: fix check for address wrap in relocation
PC-relative needs a signed offset; others need unsigned.
Also fix signedness of 32-bit relocation on Windows.

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

12 years agodoc/go1.1: remove discussion of "go run" change
Andrew Gerrand [Tue, 30 Apr 2013 13:47:23 +0000 (09:47 -0400)]
doc/go1.1: remove discussion of "go run" change

Update #5164

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

12 years agocmd/ld: disable relocation range check so build can go green while we debug the issue.
Rob Pike [Tue, 30 Apr 2013 07:19:21 +0000 (00:19 -0700)]
cmd/ld: disable relocation range check so build can go green while we debug the issue.

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

12 years agocmd/gc: fix some overflows in the compiler
Rob Pike [Tue, 30 Apr 2013 05:44:40 +0000 (22:44 -0700)]
cmd/gc: fix some overflows in the compiler
Some 64-bit fields were run through 32-bit words, some counts were
not checked for overflow, and relocations must fit in 32 bits.
Tests to follow.

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

12 years agocmd/ld: fix some 64-bit issues
Rob Pike [Tue, 30 Apr 2013 05:44:20 +0000 (22:44 -0700)]
cmd/ld: fix some 64-bit issues
A few places in the linker pushed 64-bit values through 32-bit holes,
including in relocation.
Clean them up, and check for a few other overflows as well.
Tests to follow.

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

12 years agoencoding/json: document that marshaling invalid utf-8 sequence will return error
Shenghou Ma [Tue, 30 Apr 2013 03:21:48 +0000 (11:21 +0800)]
encoding/json: document that marshaling invalid utf-8 sequence will return error
Also added docs for InvalidUTF8Error.
Fixes #5360.

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

12 years agofmt: fix crash for Printf("%.", 3)
Rob Pike [Mon, 29 Apr 2013 20:52:07 +0000 (13:52 -0700)]
fmt: fix crash for Printf("%.", 3)
Fixes #5311

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

12 years agoruntime: fix stack pointer corruption in runtime.cgocallback_gofunc()
Shenghou Ma [Mon, 29 Apr 2013 20:13:32 +0000 (04:13 +0800)]
runtime: fix stack pointer corruption in runtime.cgocallback_gofunc()
runtime.setmg() calls another function (cgo_save_gm), so it must save
LR onto stack.
Re-enabled TestCthread test in misc/cgo/test.

Fixes #4863.

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

12 years agofmt: document that if String or Error panics, that value is printed
Ian Lance Taylor [Mon, 29 Apr 2013 19:01:32 +0000 (12:01 -0700)]
fmt: document that if String or Error panics, that value is printed

Fixes #5350.

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

12 years agonet/http/httptest: fix incorrectly-named ResponseRecorder example
Andrew Gerrand [Mon, 29 Apr 2013 15:34:47 +0000 (17:34 +0200)]
net/http/httptest: fix incorrectly-named ResponseRecorder example

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

12 years agomath/rand: fix typo and add better crash message
Brad Fitzpatrick [Sun, 28 Apr 2013 01:50:38 +0000 (18:50 -0700)]
math/rand: fix typo and add better crash message

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

12 years agoruntime: tune appendCrossover for arm
Dave Cheney [Sat, 27 Apr 2013 14:18:11 +0000 (00:18 +1000)]
runtime: tune appendCrossover for arm

Turns out the optimal value is 8 on cortex-A9 systems (pandaboard)

benchmark                     old ns/op    new ns/op    delta
BenchmarkAppend                     907          908   +0.11%
BenchmarkAppend1Byte                101          101   +0.00%
BenchmarkAppend4Bytes               116          116   +0.00%
BenchmarkAppend8Bytes               139          138   -0.72%
BenchmarkAppend16Bytes              185          158  -14.59%
BenchmarkAppend32Bytes              131          131   +0.00%
BenchmarkAppendStr1Byte              72           72   +0.00%
BenchmarkAppendStr4Bytes             93           93   -0.21%
BenchmarkAppendStr8Bytes            116          116   +0.00%
BenchmarkAppendStr16Bytes           161          125  -22.36%
BenchmarkAppendStr32Bytes           102          102   +0.00%
BenchmarkAppendSpecialCase          613          613   +0.00%

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

12 years agodatabase/sql/driver: try to unstutter Value docs
Brad Fitzpatrick [Fri, 26 Apr 2013 18:42:58 +0000 (11:42 -0700)]
database/sql/driver: try to unstutter Value docs

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

12 years agotime: stop 1ns timer in test
Dmitriy Vyukov [Fri, 26 Apr 2013 07:08:50 +0000 (11:08 +0400)]
time: stop 1ns timer in test

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

12 years agodatabase/sql: fix driver Conn refcounting with prepared statements
Brad Fitzpatrick [Thu, 25 Apr 2013 21:45:56 +0000 (14:45 -0700)]
database/sql: fix driver Conn refcounting with prepared statements

The refcounting of driver Conns was completedly busted and
would leak (be held open forever) with any reasonable
load. This was a significant regression from Go 1.0.

The core of this patch is removing one line:

     s.db.addDep(dc, s)

A database conn (dc) is a resource that be re-created any time
(but cached for speed) should not be held open forever with a
dependency refcount just because the Stmt (s) is alive (which
typically last for long periods of time, like forever).

The meat of the patch is new tests. In fixing the real issue,
a lot of tests then failed due to the fakedb_test.go's paranoia
about closing a fakeConn while it has open fakeStmts on it. I
could've ignored that, but that's been a problem in the past for
other bugs.

Instead, I now track per-Conn open statements and close them
when the the conn closes.  The proper way to do this would've
been making *driverStmt a finalCloser and using the dep mechanism,
but it was much more invasive. Added a TODO instead.

I'd like to give a way for drivers to opt-out of caring about
driver.Stmt closes before a driver.Conn close, but that's a TODO
for the future, and that TODO is added in this CL.

I know this is very late for Go 1.1, but database/sql is
currently nearly useless without this.

I'd like to believe all these database/sql bugs in the past
release cycle are the result of increased usage, number of
drivers, and good feedback from increasingly-capable Go
developers, and not the result of me sucking.  It's also hard
with all the real drivers being out-of-tree, so I'm having to
add more and more hooks to fakedb_test.go to simulate things
which real drivers end up doing.

Fixes #5323

R=golang-dev, snaury, gwenn.kahz, google, r
CC=golang-dev
https://golang.org/cl/8836045

12 years agocmd/gc: initialize t->width in dgcsym() if required
Jan Ziak [Thu, 25 Apr 2013 16:47:12 +0000 (18:47 +0200)]
cmd/gc: initialize t->width in dgcsym() if required

Update #5291.

R=golang-dev, daniel.morsing, iant, r
CC=golang-dev
https://golang.org/cl/8663052

12 years agoundo CL 8954044 / ad3c2ffb16d7
Jan Ziak [Thu, 25 Apr 2013 16:12:09 +0000 (18:12 +0200)]
undo CL 8954044 / ad3c2ffb16d7

It works on i386, but fails on amd64 and arm.

««« original CL description
runtime: prevent the GC from seeing the content of a frame in runfinq()

Fixes #5348.

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

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

12 years agoruntime: prevent the GC from seeing the content of a frame in runfinq()
Jan Ziak [Thu, 25 Apr 2013 11:39:09 +0000 (13:39 +0200)]
runtime: prevent the GC from seeing the content of a frame in runfinq()

Fixes #5348.

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

12 years agonet: deflake raw IP protocol entry test on Windows
Mikio Hara [Thu, 25 Apr 2013 04:23:24 +0000 (13:23 +0900)]
net: deflake raw IP protocol entry test on Windows

Update #5344

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

12 years agocmd/vet: clean up the test
Rob Pike [Wed, 24 Apr 2013 17:40:29 +0000 (10:40 -0700)]
cmd/vet: clean up the test
- clean up the notypes version of the test so it's quiet
- change the package in the buildtag test to avoid confusing godoc

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

12 years agocmd/5g, cmd/6g, cmd/8g: more nil ptr to large struct checks
Ian Lance Taylor [Wed, 24 Apr 2013 15:13:01 +0000 (08:13 -0700)]
cmd/5g, cmd/6g, cmd/8g: more nil ptr to large struct checks

R=r, ken, khr, daniel.morsing
CC=dsymonds, golang-dev, rickyz
https://golang.org/cl/8925043

12 years agonet: add missing File method document
Mikio Hara [Tue, 23 Apr 2013 23:32:11 +0000 (08:32 +0900)]
net: add missing File method document

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

12 years agocmd/dist: fix line numbers in goc2c generated files
Anthony Martin [Tue, 23 Apr 2013 23:02:50 +0000 (16:02 -0700)]
cmd/dist: fix line numbers in goc2c generated files

We have to reset the global lineno variable before
processing each file otherwise line numbers will be
offset by the number of lines in the previous file.

The following examples are from the beginning of the
ztime_linux_amd64.c file which is generated from
time.goc in the runtime package.

Before:
    #line 2483 "/home/apm/src/go/src/pkg/runtime/time.goc"
    static Timers timers;
    static void addtimer ( Timer* ) ;
    void
    time·Sleep(int64 ns)
    {
    #line 2492 "/home/apm/src/go/src/pkg/runtime/time.goc"

After:
    #line 16 "/home/apm/src/go/src/pkg/runtime/time.goc"
    static Timers timers;
    static void addtimer ( Timer* ) ;
    void
    time·Sleep(int64 ns)
    {
    #line 25 "/home/apm/src/go/src/pkg/runtime/time.goc"

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

12 years agoall: fix typos
Shenghou Ma [Tue, 23 Apr 2013 20:46:14 +0000 (04:46 +0800)]
all: fix typos

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

12 years agodoc/code.html: remove doubled word; modify the tab to space.
Oling Cat [Tue, 23 Apr 2013 20:13:51 +0000 (13:13 -0700)]
doc/code.html: remove doubled word; modify the tab to space.

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

12 years agodoc: fix typo in race_detector.html
Jeremy Jackins [Tue, 23 Apr 2013 20:11:58 +0000 (13:11 -0700)]
doc: fix typo in race_detector.html

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

12 years agodoc/effective_go.html: fix syntax error in code example
Shenghou Ma [Tue, 23 Apr 2013 19:51:31 +0000 (03:51 +0800)]
doc/effective_go.html: fix syntax error in code example
Fixes #5333.

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

12 years agonet: fix protocol number for IPv6 test
Mikio Hara [Tue, 23 Apr 2013 11:30:42 +0000 (20:30 +0900)]
net: fix protocol number for IPv6 test

The protocol number of ICMP for IPv6 is 58, not 1.

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

12 years agotime: fix typo in comment
Christian Himpel [Tue, 23 Apr 2013 05:09:11 +0000 (22:09 -0700)]
time: fix typo in comment

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

12 years agolib/time: update to IANA 2013c
Rob Pike [Mon, 22 Apr 2013 23:28:42 +0000 (16:28 -0700)]
lib/time: update to IANA 2013c
This should do it for the release.
There was a new data set pushed out a couple of days ago.

Fixes #4553.

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

12 years agotime: fix typo in comment
Rob Pike [Mon, 22 Apr 2013 22:41:06 +0000 (15:41 -0700)]
time: fix typo in comment

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

12 years agomisc/cgo/testso: enable test on windows
Shenghou Ma [Mon, 22 Apr 2013 20:42:04 +0000 (04:42 +0800)]
misc/cgo/testso: enable test on windows
Depends on CL 8715043 and CL 8676050.
Fixes #5273.

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

12 years agotime: improve the explanation of the working of Format and Parse
Rob Pike [Mon, 22 Apr 2013 18:36:17 +0000 (11:36 -0700)]
time: improve the explanation of the working of Format and Parse
Change the term 'standard time', which already means something,
to 'reference time', and add a couple of sentences and clarifications.

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

12 years agonet/http: make CloseNotifier channel buffered to not leak goroutines
Brad Fitzpatrick [Mon, 22 Apr 2013 17:32:10 +0000 (10:32 -0700)]
net/http: make CloseNotifier channel buffered to not leak goroutines

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

12 years agodoc: fix typo in Effective Go
Andrew Gerrand [Mon, 22 Apr 2013 14:57:23 +0000 (16:57 +0200)]
doc: fix typo in Effective Go

Fixes #5329.

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

12 years agodoc: add missing <code> to go1.1.html
Jonathan Rudenberg [Sun, 21 Apr 2013 11:10:19 +0000 (13:10 +0200)]
doc: add missing <code> to go1.1.html

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

12 years agoapi: update next.txt; add io.ErrNoProgress
Brad Fitzpatrick [Sun, 21 Apr 2013 00:20:58 +0000 (17:20 -0700)]
api: update next.txt; add io.ErrNoProgress

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

12 years agosort: don't depend on math
Brad Fitzpatrick [Sun, 21 Apr 2013 00:20:41 +0000 (17:20 -0700)]
sort: don't depend on math

No reason to pull in math just for x != x.

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

12 years agonet/http: fix a panic in Redirect
Brad Fitzpatrick [Sun, 21 Apr 2013 00:20:14 +0000 (17:20 -0700)]
net/http: fix a panic in Redirect

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

12 years agocmd/ld: do not relocate ignored PE sections
Alex Brainman [Sat, 20 Apr 2013 07:42:14 +0000 (17:42 +1000)]
cmd/ld: do not relocate ignored PE sections

This should have been part of CL8715043.

Update #5106

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

12 years agonet: enable test for runtime.PollDesc leak
Mikio Hara [Sat, 20 Apr 2013 00:04:20 +0000 (09:04 +0900)]
net: enable test for runtime.PollDesc leak

Update #5219.

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

12 years agodoc: fix another broken link
Brad Fitzpatrick [Fri, 19 Apr 2013 19:00:40 +0000 (12:00 -0700)]
doc: fix another broken link

Fixes #5316

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

12 years agocmd/ld: don't show cursym in gcc invocation failure message
Shenghou Ma [Fri, 19 Apr 2013 18:44:16 +0000 (02:44 +0800)]
cmd/ld: don't show cursym in gcc invocation failure message
before:
fmt.statictmp_0731:/usr/local/go/pkg/tool/linux_amd64/6l: running gcc failed: unsuccessful exit status 0x100
now:
/usr/local/go/pkg/tool/linux_amd64/6l: running gcc failed: unsuccessful exit status 0x100

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

12 years agobufio.Scan: don't stop after Read returns 0, nil
Rob Pike [Fri, 19 Apr 2013 00:37:21 +0000 (17:37 -0700)]
bufio.Scan: don't stop after Read returns 0, nil
But stop eventually if the reader misbehaves.

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

12 years agodoc/go1.1.html: document io.ErrNoProgress
Rob Pike [Fri, 19 Apr 2013 00:37:09 +0000 (17:37 -0700)]
doc/go1.1.html: document io.ErrNoProgress

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

12 years agoio: explain what (0,nil) means from Read
Rob Pike [Fri, 19 Apr 2013 00:36:25 +0000 (17:36 -0700)]
io: explain what (0,nil) means from Read
Also add a new variable ErrNoProgress that io.Readers can use to
report ineffectual Read calls.
Fixes #5310.

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

12 years agodoc: fix another broken link
Brad Fitzpatrick [Thu, 18 Apr 2013 21:48:54 +0000 (14:48 -0700)]
doc: fix another broken link

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

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