]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agoapi: refresh next.txt
Russ Cox [Fri, 15 Feb 2013 21:33:14 +0000 (16:33 -0500)]
api: refresh next.txt

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

12 years agoruntime: allow mem profiles with GOGC=off
Russ Cox [Fri, 15 Feb 2013 19:48:58 +0000 (14:48 -0500)]
runtime: allow mem profiles with GOGC=off

Fixes #3586.

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

12 years agoruntime: show frame pointer values during throw
Russ Cox [Fri, 15 Feb 2013 19:48:47 +0000 (14:48 -0500)]
runtime: show frame pointer values during throw

Should help if stack overflows start happening again.

Fixes #3582.

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

12 years agoruntime: make return from main wait for active panic
Russ Cox [Fri, 15 Feb 2013 19:48:35 +0000 (14:48 -0500)]
runtime: make return from main wait for active panic

Arguably if this happens the program is buggy anyway,
but letting the panic continue looks better than interrupting it.
Otherwise things like this are possible, and confusing:

$ go run x.go
panic: $ echo $?
0
$

Fixes #3934.

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

12 years agocmd/go: reject case-insensitive file name, import collisions
Russ Cox [Fri, 15 Feb 2013 19:39:39 +0000 (14:39 -0500)]
cmd/go: reject case-insensitive file name, import collisions

To make sure that Go code will work when moved to a
system with a case-insensitive file system, like OS X or Windows,
reject any package built from files with names differing
only in case, and also any package built from imported
dependencies with names differing only in case.

Fixes #4773.

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

12 years agospec: clarify when range x does not evaluate x
Russ Cox [Fri, 15 Feb 2013 19:39:28 +0000 (14:39 -0500)]
spec: clarify when range x does not evaluate x

Fixes #4644.

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

12 years agoruntime/pprof: adjust reported line numbers to show call sites
Russ Cox [Fri, 15 Feb 2013 19:27:16 +0000 (14:27 -0500)]
runtime/pprof: adjust reported line numbers to show call sites

This is the same logic used in the standard tracebacks.
The caller pc is the pc after the call, so except in the
fake "call" caused by a panic, back up the pc enough
that the lookup will use the previous instruction.

Fixes #4150.
Fixes #4151.

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

12 years agoruntime: allocate heap metadata at run time
Russ Cox [Fri, 15 Feb 2013 19:27:03 +0000 (14:27 -0500)]
runtime: allocate heap metadata at run time

Before, the mheap structure was in the bss,
but it's quite large (today, 256 MB, much of
which is never actually paged in), and it makes
Go binaries run afoul of exec-time bss size
limits on some BSD systems.

Fixes #4447.

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

12 years agoruntime: ensure forward progress of runtime.Gosched() for locked goroutines
Dmitriy Vyukov [Fri, 15 Feb 2013 18:22:13 +0000 (22:22 +0400)]
runtime: ensure forward progress of runtime.Gosched() for locked goroutines
The removed code leads to the situation when M executes the same locked G again and again.
Fixes #4820.

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

12 years agoruntime: check rt_sigaction return values on linux
Russ Cox [Fri, 15 Feb 2013 18:13:19 +0000 (13:13 -0500)]
runtime: check rt_sigaction return values on linux

(If the mask size is wrong the system call fails.)

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

12 years agoencoding/binary: make type error more specific
Russ Cox [Fri, 15 Feb 2013 18:12:28 +0000 (13:12 -0500)]
encoding/binary: make type error more specific

Right now it says 'invalid type S' for a struct type S.
Instead, say which type inside the struct is the problem.

Fixes #4825.

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

12 years agoexp/cookiejar: fix windows/386 build
Russ Cox [Fri, 15 Feb 2013 17:43:28 +0000 (12:43 -0500)]
exp/cookiejar: fix windows/386 build

More mysteriously broken tests.

TBR=nigeltao
CC=golang-dev
https://golang.org/cl/7342048

12 years agoruntime: fix build on linux
Russ Cox [Fri, 15 Feb 2013 17:18:33 +0000 (12:18 -0500)]
runtime: fix build on linux

In addition to the compile failure fixed in signal*.c,
preserving the signal mask led to very strange crashes.
Testing shows that looking for SIG_IGN is all that
matters to get along with nohup, so reintroduce
sigset_zero instead of trying to preserve the signal mask.

TBR=iant
CC=golang-dev
https://golang.org/cl/7323067

12 years agoexp/cookiejar: fix windows builder
Russ Cox [Fri, 15 Feb 2013 16:32:31 +0000 (11:32 -0500)]
exp/cookiejar: fix windows builder

TBR=nigeltao
CC=golang-dev
https://golang.org/cl/7322084

12 years agoruntime: fix running under nohup
Russ Cox [Fri, 15 Feb 2013 16:18:55 +0000 (11:18 -0500)]
runtime: fix running under nohup

There are two ways nohup(1) might be implemented:
it might mask away the signal, or it might set the handler
to SIG_IGN, both of which are inherited across fork+exec.
So two fixes:

* Make sure to preserve the inherited signal mask at
minit instead of clearing it.

* If the SIGHUP handler is SIG_IGN, leave it that way.

Fixes #4491.

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

12 years agocrypto/x509: support IP SANs.
Adam Langley [Fri, 15 Feb 2013 15:40:17 +0000 (10:40 -0500)]
crypto/x509: support IP SANs.

Subject Alternative Names in X.509 certificates may include IP
addresses. This change adds support for marshaling, unmarshaling and
verifying this form of SAN.

It also causes IP addresses to only be checked against IP SANs,
rather than against hostnames as was previously the case. This
reflects RFC 6125.

Fixes #4658.

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

12 years agoruntime: fix debug output
Dmitriy Vyukov [Fri, 15 Feb 2013 13:04:02 +0000 (17:04 +0400)]
runtime: fix debug output

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

12 years agomime: do not test for .wav on windows
Alex Brainman [Fri, 15 Feb 2013 05:55:51 +0000 (16:55 +1100)]
mime: do not test for .wav on windows

Even builders don't have that mime type

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

12 years agomime: use .wav instead of .bmp during windows tests
Alex Brainman [Fri, 15 Feb 2013 04:52:54 +0000 (15:52 +1100)]
mime: use .wav instead of .bmp during windows tests

Some systems do not have .bmp mime.

Update #4723.

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

12 years agonet: delete TestDialTimeoutHandleLeak
Alex Brainman [Fri, 15 Feb 2013 04:52:12 +0000 (15:52 +1100)]
net: delete TestDialTimeoutHandleLeak

It is too flaky. Tried to make it more reliable,
but that affects other tests (they run too long),
because we do unusual things here, like attempting
to connect to non-existing address and interrupt.

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

12 years agoruntime: expand error for signal received on non-Go thread.
Alan Donovan [Fri, 15 Feb 2013 04:37:14 +0000 (23:37 -0500)]
runtime: expand error for signal received on non-Go thread.

We call runtime.findnull dynamically to avoid exceeding the
static nosplit stack limit check.  (Thanks minux!)

Fixes #4048.

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

12 years agocmd/godoc: add support for doc.Package.Notes
Cosmos Nicolaou [Fri, 15 Feb 2013 04:35:08 +0000 (20:35 -0800)]
cmd/godoc: add support for doc.Package.Notes

Add support for displaying the notes of the form 'MARKER(userid): comment' now collected by the go/doc package. Any two or more uppercase letters are recognised as a marker.

R=gri, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7334044

12 years agogo/doc: add support for arbitrary notes
Cosmos Nicolaou [Fri, 15 Feb 2013 04:20:32 +0000 (20:20 -0800)]
go/doc: add support for arbitrary notes

Add support for arbitrary notes of the form // MARKER(userid): comment
in the same vein as BUG(userid): A marker must be two or more upper case [A-Z] letters.

R=gri, rsc, bradfitz, jscrockett01
CC=golang-dev
https://golang.org/cl/7322061

12 years agodoc/contribute: fix some tags, remove extra space.
Oling Cat [Fri, 15 Feb 2013 03:01:12 +0000 (14:01 +1100)]
doc/contribute: fix some tags, remove extra space.

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

12 years agocmd/ld: fix -s flag for ELF executables
Anthony Martin [Fri, 15 Feb 2013 02:43:54 +0000 (18:43 -0800)]
cmd/ld: fix -s flag for ELF executables

This fixes a regression introduced in changeset 98034d036d03
which added support for producing host object files.

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

12 years agolog/syslog: fix channel race in test.
Rémy Oudompheng [Fri, 15 Feb 2013 00:07:31 +0000 (11:07 +1100)]
log/syslog: fix channel race in test.

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

12 years agomisc/dashboard/builder: record build result on dashboard
Dave Cheney [Thu, 14 Feb 2013 23:44:29 +0000 (10:44 +1100)]
misc/dashboard/builder: record build result on dashboard

This is part one of two changes intended to make it easier to debug builder failures.

runOutput allows us to control the io.Writer passed to a subcommand. The intention is to add additional debugging information before and after the build which will then be capture and sent to the dashboard.

In this proposal, the only additional information is the build status. See http://build.golang.org/log/e7b5bf435b4de1913fc61781b3295fb3f03aeb6e

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

12 years agosrc/cmd/gc: fix some typos in the escape analysis comments
Carl Shapiro [Thu, 14 Feb 2013 23:38:57 +0000 (15:38 -0800)]
src/cmd/gc: fix some typos in the escape analysis comments

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

12 years agogo/parser: cleanups following CL 7307085
Robert Griesemer [Thu, 14 Feb 2013 21:36:40 +0000 (13:36 -0800)]
go/parser: cleanups following CL 7307085

- use the new AllErrors flag where appropriate
- unless AllErrors is set, eliminate spurious
  errors before they are added to the errors list
  (it turns out that reporting spurious errors always
  leads to too many uninformative errors after all)

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

12 years agoC: add Cosmos Nicolaou (Google CLA)
Robert Griesemer [Thu, 14 Feb 2013 21:35:52 +0000 (13:35 -0800)]
C: add Cosmos Nicolaou (Google CLA)

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

12 years agocmd/gc: remove node printing in redeclare errors
Daniel Morsing [Thu, 14 Feb 2013 20:11:47 +0000 (21:11 +0100)]
cmd/gc: remove node printing in redeclare errors

I suspect this is some debugging which got through the submission process.

Fixes #4789.

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

12 years agoruntime: add more tests for LockOSThread()
Dmitriy Vyukov [Thu, 14 Feb 2013 20:02:12 +0000 (00:02 +0400)]
runtime: add more tests for LockOSThread()
Just test some additional paths through the scheduler.

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

12 years agocmd/go: fix vet
Russ Cox [Thu, 14 Feb 2013 20:00:51 +0000 (15:00 -0500)]
cmd/go: fix vet

The IgnoredGoFiles are already listed in allgofiles,
so they were being run twice. Worse, the ones in
IgnoredGoFiles are not fully qualified paths, so they
weren't being found when executed outside the
package directory.

Fixes #4764.

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

12 years agoencoding/json: document and test use of unicode.ReplacementChar
Russ Cox [Thu, 14 Feb 2013 19:56:01 +0000 (14:56 -0500)]
encoding/json: document and test use of unicode.ReplacementChar

Fixes #4783.

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

12 years agocmd/gc: replace x*8 by x<<3 etc
Russ Cox [Thu, 14 Feb 2013 19:54:00 +0000 (14:54 -0500)]
cmd/gc: replace x*8 by x<<3 etc

Fixes #4199.

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

12 years agocmd/8g: fix sse2 compare code gen
Russ Cox [Thu, 14 Feb 2013 19:49:04 +0000 (14:49 -0500)]
cmd/8g: fix sse2 compare code gen

Fixes #4785.

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

12 years agoencoding/json: roll back Unmarshal optimization + test
Russ Cox [Thu, 14 Feb 2013 19:46:15 +0000 (14:46 -0500)]
encoding/json: roll back Unmarshal optimization + test

The second attempt at the Unmarshal optimization allowed
panics to get out of the json package. Add test for that bug
and remove the optimization.

Let's stop trying to optimize Unmarshal.

Fixes #4784.

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

12 years agogo/types: avoid os.Getwd if not necessary
Russ Cox [Thu, 14 Feb 2013 19:46:03 +0000 (14:46 -0500)]
go/types: avoid os.Getwd if not necessary

Getwd can be very expensive.

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

12 years agogo/parser: stop ParseFile after ten errors.
Michael Matloob [Thu, 14 Feb 2013 19:26:21 +0000 (11:26 -0800)]
go/parser: stop ParseFile after ten errors.

There wil be a panic if more than ten errors are encountered. ParseFile
will recover and return the ErrorList.

Fixes #3943.

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

12 years agoC: add Michael Matloob (Google CLA)
Robert Griesemer [Thu, 14 Feb 2013 19:25:33 +0000 (11:25 -0800)]
C: add Michael Matloob (Google CLA)

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

12 years agosyscall: don't make //sys lines be doc comments
Brad Fitzpatrick [Thu, 14 Feb 2013 19:23:58 +0000 (11:23 -0800)]
syscall: don't make //sys lines be doc comments

Cleans up godoc and makes it consistent. (some had it, some
didn't)

This still keeps the information there, though, for people
looking at the source directly.

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

12 years agocmd/go: set $PWD when running commands
Russ Cox [Thu, 14 Feb 2013 19:21:44 +0000 (14:21 -0500)]
cmd/go: set $PWD when running commands

This makes os.Getwd inside those commands much faster.

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

12 years agotest/run: use correct $PWD to make os.Getwd less expensive
Russ Cox [Thu, 14 Feb 2013 19:21:26 +0000 (14:21 -0500)]
test/run: use correct $PWD to make os.Getwd less expensive

The commands being run are 'go tool this' and 'go tool that',
and the go command will call Getwd during its init.

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

12 years agoos: cache Getwd result as hint for next time
Russ Cox [Thu, 14 Feb 2013 19:21:09 +0000 (14:21 -0500)]
os: cache Getwd result as hint for next time

Avoids the dot-dot-based algorithm on repeated calls
when the directory hasn't changed.

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

12 years agonet: document OpError
Brad Fitzpatrick [Thu, 14 Feb 2013 17:29:34 +0000 (09:29 -0800)]
net: document OpError

Fixes #4797

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

12 years agoexp/cookiejar: implement Cookies and provided tests
Volker Dobler [Thu, 14 Feb 2013 08:41:58 +0000 (19:41 +1100)]
exp/cookiejar: implement Cookies and provided tests

This CL provides the implementation of Cookies and
the complete test suite. Several tests have been ported
from the Chromium project as a cross check.

R=nigeltao, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7311073

12 years agoruntime: move stack management related code to stack.c
Dmitriy Vyukov [Thu, 14 Feb 2013 08:37:55 +0000 (12:37 +0400)]
runtime: move stack management related code to stack.c
No code changes.
This is mainly in preparation to scheduler changes,
oldstack/newstack are not related to scheduling.

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

12 years agonet/textproto: more efficient header parsing
Dave Cheney [Thu, 14 Feb 2013 08:35:38 +0000 (19:35 +1100)]
net/textproto: more efficient header parsing

A co creation with bradfitz

* add fast path for header lines which are not continuations
* pass hint to better size initial mime header map

lucky(~/go/src/pkg/net/http) % ~/go/misc/benchcmp {golden,new}.txt
benchmark                          old ns/op    new ns/op    delta
BenchmarkReadRequestChrome             10073         8348  -17.12%
BenchmarkReadRequestCurl                4368         4350   -0.41%
BenchmarkReadRequestApachebench         4412         4397   -0.34%
BenchmarkReadRequestSiege               6431         5924   -7.88%
BenchmarkReadRequestWrk                 2820         3146  +11.56%

benchmark                           old MB/s     new MB/s  speedup
BenchmarkReadRequestChrome             60.66        73.18    1.21x
BenchmarkReadRequestCurl               17.85        17.93    1.00x
BenchmarkReadRequestApachebench        18.58        18.65    1.00x
BenchmarkReadRequestSiege              23.48        25.49    1.09x
BenchmarkReadRequestWrk                14.18        12.71    0.90x

benchmark                         old allocs   new allocs    delta
BenchmarkReadRequestChrome                32           26  -18.75%
BenchmarkReadRequestCurl                  15           15    0.00%
BenchmarkReadRequestApachebench           16           15   -6.25%
BenchmarkReadRequestSiege                 22           19  -13.64%
BenchmarkReadRequestWrk                   11           11    0.00%

benchmark                          old bytes    new bytes    delta
BenchmarkReadRequestChrome              3148         2216  -29.61%
BenchmarkReadRequestCurl                 905         1413   56.13%
BenchmarkReadRequestApachebench          956         1413   47.80%
BenchmarkReadRequestSiege               1397         1522    8.95%
BenchmarkReadRequestWrk                  757         1369   80.85%

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

12 years agoarchive/tar: add Header.FileInfo method. Add more cases to FileInfoHeader.
Robin Eklind [Thu, 14 Feb 2013 06:32:48 +0000 (17:32 +1100)]
archive/tar: add Header.FileInfo method. Add more cases to FileInfoHeader.

FileInfoHeader can now handle fifo, setuid, setgid and sticky bits.

Fixes #4695.

R=golang-dev, donovanhide, r.eklind.87, minux.ma, adg
CC=golang-dev
https://golang.org/cl/7305072

12 years agosort: use fewer comparisons when choosing pivot.
David Symonds [Thu, 14 Feb 2013 04:04:22 +0000 (15:04 +1100)]
sort: use fewer comparisons when choosing pivot.

This is based on rsc's code posted to issue 2585.

Benchmark results are greatly improved:
        benchmark                old ns/op    new ns/op    delta
        BenchmarkSortString1K       564397       445897  -21.00%
        BenchmarkSortInt1K          270889       221249  -18.32%
        BenchmarkSortInt64K       26850765     21351967  -20.48%

Eyeballing a sampling of the raw number of comparisons shows a drop
on the order of 20-30% almost everywhere. The test input data that
doesn't match that are some of sawtooth/rand/plateau distributions,
where there is no change in the number of comparisons; that is,
there are no situations where this makes *more* comparisons.

Fixes #2585.

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

12 years agocmd/vet: drop column information from error
Russ Cox [Thu, 14 Feb 2013 03:34:37 +0000 (22:34 -0500)]
cmd/vet: drop column information from error

The column information can be misleading.

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

12 years agoruntime: tweak addfinroots to preserve original pointer
Russ Cox [Thu, 14 Feb 2013 03:31:45 +0000 (22:31 -0500)]
runtime: tweak addfinroots to preserve original pointer

Use local variable so that stack trace will show value of v.

Fixes #4790.

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

12 years agodatabase/sql: fix doc references to old package name
Brad Fitzpatrick [Thu, 14 Feb 2013 02:47:25 +0000 (18:47 -0800)]
database/sql: fix doc references to old package name

It used to be package "db" but was long ago renamed
to be "sql".

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

12 years agonet/http: test that we preserve Go 1.0 Request.Write Host behavior
Brad Fitzpatrick [Thu, 14 Feb 2013 02:33:15 +0000 (18:33 -0800)]
net/http: test that we preserve Go 1.0 Request.Write Host behavior

Fixes #4792

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

12 years agocmd/8c: disable use of prefetch with GO386=387
Russ Cox [Thu, 14 Feb 2013 02:13:07 +0000 (21:13 -0500)]
cmd/8c: disable use of prefetch with GO386=387

Fixes #4798.

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

12 years agodatabase/sql: Add an optional Queryer-Interface (like Execer)
Julien Schmidt [Wed, 13 Feb 2013 23:25:39 +0000 (15:25 -0800)]
database/sql: Add an optional Queryer-Interface (like Execer)

Completly the same like the Execer-Interface, just for Queries.
This allows Drivers to execute Queries without preparing them first

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

12 years agonet: remove noisy test for issue 3590
Dave Cheney [Wed, 13 Feb 2013 23:11:16 +0000 (10:11 +1100)]
net: remove noisy test for issue 3590

The test for issue 3590 causes an error to be printed to stderr when run (although the error is obscured during go test std). This is confusing for people who get breakage in the net package as the error is harmless and most likely unrelated to their build breakage.

Given the way the test works, by reaching into the guts of the netFD, I can't see a way to silence the error without adding a bunch of code to support the test, therefore I am suggesting the test be removed before Go 1.1 ships.

R=alex.brainman, mikioh.mikioh, rsc
CC=golang-dev
https://golang.org/cl/7307110

12 years agonet: add test for Dial and Listen arguments
Mikio Hara [Wed, 13 Feb 2013 22:02:32 +0000 (07:02 +0900)]
net: add test for Dial and Listen arguments

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

12 years agoio: document and test new CopyN return behavior
Brad Fitzpatrick [Wed, 13 Feb 2013 21:52:00 +0000 (13:52 -0800)]
io: document and test new CopyN return behavior

Changed accidentally in 28966b7b2f0c (CopyN using Copy).
Updating docs to be consistent with 29bf5ff5064e (ReadFull & ReadAtLeast)

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

12 years agocmd/5l: fix print format
Lucio De Re [Wed, 13 Feb 2013 21:47:33 +0000 (16:47 -0500)]
cmd/5l: fix print format

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

12 years agodatabase/sql: add currently-disabled broken test
Brad Fitzpatrick [Wed, 13 Feb 2013 20:00:03 +0000 (12:00 -0800)]
database/sql: add currently-disabled broken test

Update #3865

R=golang-dev, alex.brainman, nightlyone
CC=golang-dev
https://golang.org/cl/7324051

12 years agogo/types: adjust gcimporter to actual gc export data
Robert Griesemer [Wed, 13 Feb 2013 18:21:24 +0000 (10:21 -0800)]
go/types: adjust gcimporter to actual gc export data

Unexported field and method names that appear in the
export data (as part of some exported type) are fully
qualified with a package id (path). In some cases, a
package with that id was never exported for any other
use (i.e. only the path is of interest).

We must not create a "real" package in those cases
because we don't have a package name. Entering an
unnamed package into the map of imported packages
makes that package accessible for other imports.
Such a subsequent import may find the unnamed
package in the map, and reuse it. That reused and
imported package is then entered into the importing
file scope, still w/o a name. References to that
package cannot resolved after that. Was bug.

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

12 years agoruntime: instrument slicebytetostring for race detection
Dmitriy Vyukov [Wed, 13 Feb 2013 14:29:59 +0000 (18:29 +0400)]
runtime: instrument slicebytetostring for race detection

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

12 years agoarchive/tar: append a slash when deriving header info from a directory
Christian Himpel [Wed, 13 Feb 2013 08:23:28 +0000 (19:23 +1100)]
archive/tar: append a slash when deriving header info from a directory

This behavior is identical to GNU tar 1.26.

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

12 years agodoc: adjust indentation in Effective Go commentary example.
David Symonds [Wed, 13 Feb 2013 05:43:55 +0000 (16:43 +1100)]
doc: adjust indentation in Effective Go commentary example.

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

12 years agonet: change server_test.go so we could see failure messages
Alex Brainman [Wed, 13 Feb 2013 05:17:47 +0000 (16:17 +1100)]
net: change server_test.go so we could see failure messages

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

12 years agoexp/ssa: add Instruction.Operands and Value.Referrers methods.
Alan Donovan [Wed, 13 Feb 2013 05:15:07 +0000 (00:15 -0500)]
exp/ssa: add Instruction.Operands and Value.Referrers methods.

Operands returns the SSA values used by an instruction.
Referrers returns the SSA instructions that use a value, for
some values.  These will be used for SSA renaming, to follow.

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

12 years agogo/types: print, println accept 0 or more arguments
Robert Griesemer [Wed, 13 Feb 2013 03:40:20 +0000 (19:40 -0800)]
go/types: print, println accept 0 or more arguments

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

12 years agoos: do not use hosts file for windows tests
Alex Brainman [Wed, 13 Feb 2013 02:19:06 +0000 (13:19 +1100)]
os: do not use hosts file for windows tests

Not everyone has the file (http://golang.org/issue/4723#c4).

Update #4723.

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

12 years agoexp/ssa: omit Function's package name when printing intra-package references.
Alan Donovan [Tue, 12 Feb 2013 21:13:14 +0000 (16:13 -0500)]
exp/ssa: omit Function's package name when printing intra-package references.

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

12 years agoencoding/xml: fix htmlAutoClose and its generating script
Shenghou Ma [Tue, 12 Feb 2013 18:27:42 +0000 (02:27 +0800)]
encoding/xml: fix htmlAutoClose and its generating script
Thanks Mitică for reporting this.

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

12 years agotest: ensure all failing tests exit nonzero.
Alan Donovan [Tue, 12 Feb 2013 18:17:49 +0000 (13:17 -0500)]
test: ensure all failing tests exit nonzero.

Previously merely printing an error would cause the golden
file comparison (in 'bash run') to fail, but that is no longer
the case with the new run.go driver.

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

12 years agogo/build, runtime/cgo: cgo support for NetBSD/ARM
Shenghou Ma [Tue, 12 Feb 2013 17:06:52 +0000 (01:06 +0800)]
go/build, runtime/cgo: cgo support for NetBSD/ARM

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

12 years agosync/atomic: support NetBSD/ARM (ARM11 or above)
Shenghou Ma [Tue, 12 Feb 2013 17:04:13 +0000 (01:04 +0800)]
sync/atomic: support NetBSD/ARM (ARM11 or above)

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

12 years agosyscall: NetBSD/ARM support
Shenghou Ma [Tue, 12 Feb 2013 17:03:25 +0000 (01:03 +0800)]
syscall: NetBSD/ARM support

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

12 years agoruntime: NetBSD/ARM support
Shenghou Ma [Tue, 12 Feb 2013 17:00:04 +0000 (01:00 +0800)]
runtime: NetBSD/ARM support

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

12 years agoexp/locale/collate: moved low-level collation functionality
Marcel van Lohuizen [Tue, 12 Feb 2013 14:59:55 +0000 (15:59 +0100)]
exp/locale/collate: moved low-level collation functionality
into separate package.  This allows this code to be shared
with the search package without the need for these two to use
the same tables.
Adjusted various files accordingly.

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

12 years agogo/types: len(((*T)(nil)).X) is const if X is an array
Robert Griesemer [Tue, 12 Feb 2013 06:39:55 +0000 (22:39 -0800)]
go/types: len(((*T)(nil)).X) is const if X is an array

Fixes #4744.

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

12 years agoexp/ssa: special-case 'range' loops based on type of range expression.
Alan Donovan [Tue, 12 Feb 2013 03:12:56 +0000 (22:12 -0500)]
exp/ssa: special-case 'range' loops based on type of range expression.

The lowering of ast.RangeStmt now has three distinct cases:

1) rangeIter for maps and strings; approximately:
    it = range x
    for {
      k, v, ok = next it
      if !ok { break }
      ...
    }
   The Range instruction and the interpreter's "iter"
   datatype are now restricted to these types.

2) rangeChan for channels; approximately:
    for {
      k, ok = <-x
      if !ok { break }
      ...
    }

3) rangeIndexed for slices, arrays, and *array; approximately:
    for k, l = 0, len(x); k < l; k++ {
      v = x[k]
      ...
    }

In all cases we now evaluate the side effects of the range expression
exactly once, per comments on http://code.google.com/p/go/issues/detail?id=4644.

However the exact spec wording is still being discussed in
https://golang.org/cl/7307083/.  Further (small)
changes may be required once the dust settles.

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

12 years agotest: a number of fixes.
Alan Donovan [Mon, 11 Feb 2013 23:20:52 +0000 (18:20 -0500)]
test: a number of fixes.

Details:
- reorder.go: delete p8.
  (Once expectation is changed per b/4627 it is identical to p1.)
- switch.go: added some more (degenerate) switches.
- range.go: improved error messages in a few cases.
- method.go: added tests of calls to promoted methods.

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

12 years agovet: improve flag handling
Rob Pike [Mon, 11 Feb 2013 21:33:11 +0000 (13:33 -0800)]
vet: improve flag handling
Simplify the internal logic for flags controlling what to vet,
by introducing a map of flags that gathers them all together.
This change should simplify the process of adding further flags.

Add a test for untagged struct literals.
Delete a redundant test that was also in the wrong file.
Clean up some ERROR patterns that weren't working.

"make test" passes again.

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

12 years agoapi: Update readme.
Robin Eklind [Mon, 11 Feb 2013 17:10:35 +0000 (09:10 -0800)]
api: Update readme.

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

12 years agosync: add caution about where to call (*WaitGroup).Add
Russ Cox [Mon, 11 Feb 2013 13:05:46 +0000 (08:05 -0500)]
sync: add caution about where to call (*WaitGroup).Add

Fixes #4762.

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

12 years agospec: only require parens around ambiguous conversions
Russ Cox [Mon, 11 Feb 2013 12:48:14 +0000 (07:48 -0500)]
spec: only require parens around ambiguous conversions

This is documenting the status quo. The previous cleanup
added this language as an implementation restriction, but
at least for now it is really part of the language proper.

Fixes #4605.

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

12 years agospec: document fp rounding during explicit constant conversion
Russ Cox [Mon, 11 Feb 2013 12:47:41 +0000 (07:47 -0500)]
spec: document fp rounding during explicit constant conversion

The gc compilers already behave this way. It was an explicit
decision during the very long constant design discussions,
but it appears not to have made it into the spec.

Fixes #4398.

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

12 years agospec: reject top-level init names
Russ Cox [Mon, 11 Feb 2013 12:46:39 +0000 (07:46 -0500)]
spec: reject top-level init names

Fixes #4586.

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

12 years agomisc/dashboard: add missing return value
Andrew Gerrand [Mon, 11 Feb 2013 07:01:18 +0000 (18:01 +1100)]
misc/dashboard: add missing return value

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

12 years agocontainer/list: add package example
Andrew Gerrand [Mon, 11 Feb 2013 06:59:52 +0000 (17:59 +1100)]
container/list: add package example

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

12 years agoexp/html, exp/html/atom: delete, as they're moving to the go.net
Nigel Tao [Mon, 11 Feb 2013 00:56:49 +0000 (11:56 +1100)]
exp/html, exp/html/atom: delete, as they're moving to the go.net
sub-repo.

The matching change is at https://golang.org/cl/7310063

The rationale was discussed at
https://groups.google.com/d/topic/golang-nuts/Qq5hTQyPuLg/discussion

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

12 years agoexp/cookiejar: implementation of SetCookies
Volker Dobler [Mon, 11 Feb 2013 00:47:31 +0000 (11:47 +1100)]
exp/cookiejar: implementation of SetCookies

This CL provides the rest of the SetCookies code as well as
some test infrastructure which will be used to test also
the Cookies method. This test infrastructure is optimized
for readability and tries to make it easy to review table
driven test cases.

Tests for all the different corner cases of SetCookies
will be provided in a separate CL.

R=nigeltao, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7306054

12 years agodoc: update contribute.html
Dave Cheney [Mon, 11 Feb 2013 00:40:33 +0000 (19:40 -0500)]
doc: update contribute.html

Fixes #4582.

* mentioned hg upload.
* added section on hg file.
* added small mention about being inside $GOROOT.
* added hg revert @NNNN
* reorganise the hg submit section for the common case of a non committer.
* made the Copyright section h2
* added note about leaving copyright years unchanged.

R=golang-dev, metanata4, shivakumar.gn, minux.ma, adg, shanemhansen
CC=golang-dev, metanata4
https://golang.org/cl/7278047

12 years agoarchive/tar: read/write extended pax/gnu tar archives
Shane Hansen [Mon, 11 Feb 2013 00:36:29 +0000 (11:36 +1100)]
archive/tar: read/write extended pax/gnu tar archives

Support reading pax archives and applying extended attributes
like long names, subsecond mtime resolutions, etc. Default to
writing pax archives for long file and link names.
Support reading gnu archives using the ././@LongLink extended
header for file name and link target.

Fixes #3300

R=dsymonds, dave, rogpeppe, remyoudompheng, chressie, rsc
CC=golang-dev
https://golang.org/cl/6700047

12 years agocmd/8l/asm.c: Unused function arguments, suppress warnings.
Lucio De Re [Sun, 10 Feb 2013 23:15:56 +0000 (10:15 +1100)]
cmd/8l/asm.c: Unused function arguments, suppress warnings.

R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/7304069

12 years agodoc: move os specific build instructions to wiki
Dave Cheney [Sun, 10 Feb 2013 22:39:13 +0000 (17:39 -0500)]
doc: move os specific build instructions to wiki

Fixes #4010.

This proposal avoids cluttering the main install-source.html with OS specific instructions by linking to the wiki for details. See discussion in the comments.

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

12 years agodoc: link to wiki Projects page instead of old Project Dashboard.
Greg Ward [Sun, 10 Feb 2013 22:18:31 +0000 (09:18 +1100)]
doc: link to wiki Projects page instead of old Project Dashboard.

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

12 years agoA+C: Greg Ward (individual CLA)
Andrew Gerrand [Sun, 10 Feb 2013 22:17:00 +0000 (09:17 +1100)]
A+C: Greg Ward (individual CLA)

Generated by addca.

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

12 years agospec: clarify that any unsafe.Pointer type is okay in conversion
Russ Cox [Sat, 9 Feb 2013 22:36:31 +0000 (17:36 -0500)]
spec: clarify that any unsafe.Pointer type is okay in conversion

The spec is not clear about whether this is allowed or not,
but both compilers allow it, because the reflect implementation
takes advantage of it. Document current behavior.

Fixes #4679.

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

12 years agonet/http: more request benchmarks
Dave Cheney [Sat, 9 Feb 2013 21:18:09 +0000 (08:18 +1100)]
net/http: more request benchmarks

Add benchmarks for common http benchmarking tools. The intent is to catch optimisations which favor synthetic benchmarks that do not show improvements for real clients like Chrome.

BenchmarkReadRequestChrome        200000             10133 ns/op          60.29 MB/s        3148 B/op         32 allocs/op
BenchmarkReadRequestCurl          500000              4314 ns/op          18.08 MB/s         905 B/op         15 allocs/op
BenchmarkReadRequestApachebench   500000              4363 ns/op          18.79 MB/s         956 B/op         16 allocs/op
BenchmarkReadRequestSiege         500000              6408 ns/op          24.19 MB/s        1397 B/op         22 allocs/op
BenchmarkReadRequestWrk          1000000              2838 ns/op          14.09 MB/s         757 B/op         11 allocs/op

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

12 years agospec: clarify that f(g()) requires that g return >= 1 value
Russ Cox [Sat, 9 Feb 2013 19:46:55 +0000 (14:46 -0500)]
spec: clarify that f(g()) requires that g return >= 1 value

Fixes #4573.

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

12 years agocrypto/x509: disable SCG test with system validation.
Adam Langley [Sat, 9 Feb 2013 18:51:39 +0000 (13:51 -0500)]
crypto/x509: disable SCG test with system validation.

On Windows, CryptoAPI is finding an alternative validation path. Since
this is a little non-deterministic, this change disables that test
when using system validation.

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