]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agotime: avoid data race in abs
Rob Pike [Wed, 22 Aug 2012 21:36:23 +0000 (14:36 -0700)]
time: avoid data race in abs
Fixes #3967.

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

12 years agonet/http: Set TLSClientConfig.ServerName on every HTTP request.
Dave Borowitz [Wed, 22 Aug 2012 16:15:41 +0000 (09:15 -0700)]
net/http: Set TLSClientConfig.ServerName on every HTTP request.

This makes SNI "just work" for callers using the standard http.Client.

Since we now have a test that depends on the httptest.Server cert, change
the cert to be a CA (keeping all other fields the same).

R=bradfitz
CC=agl, dsymonds, gobot, golang-dev
https://golang.org/cl/6448154

12 years agoCONTRIBUTORS: Add Dave Borowitz (Google CLA)
Brad Fitzpatrick [Wed, 22 Aug 2012 16:01:30 +0000 (09:01 -0700)]
CONTRIBUTORS: Add Dave Borowitz (Google CLA)

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

12 years agocmd/go: fix cgo linking on netbsd
Joel Sing [Wed, 22 Aug 2012 12:23:56 +0000 (22:23 +1000)]
cmd/go: fix cgo linking on netbsd

NetBSD's built-in linker script for 'ld -r' does not provide a
SEARCH_DIR. As a result libgcc.a is not found when -lgcc is used.

Work around this by determining the path to libgcc (by invoking
gcc with the -print-libgcc-file-name option) and explicitly
referencing the resulting library.

R=golang-dev, iant, aram, lucio.dere, minux.ma
CC=golang-dev
https://golang.org/cl/6470044

12 years agoarchive/zip: zip64 support
Joakim Sernbrant [Wed, 22 Aug 2012 01:05:24 +0000 (11:05 +1000)]
archive/zip: zip64 support

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

12 years agoA+C: add Joakim Sernbrant
Andrew Gerrand [Wed, 22 Aug 2012 01:03:20 +0000 (11:03 +1000)]
A+C: add Joakim Sernbrant

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

12 years agoexp/html: refactor the parser.read method.
Nigel Tao [Tue, 21 Aug 2012 10:59:02 +0000 (20:59 +1000)]
exp/html: refactor the parser.read method.

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

12 years agonet/http: fix misplaced defer and example
Dave Cheney [Tue, 21 Aug 2012 01:46:07 +0000 (11:46 +1000)]
net/http: fix misplaced defer and example

Moves the defer (again).

Also, correct the example documentation to match.

R=r, robert.hencke, iant, dsymonds, bradfitz
CC=golang-dev
https://golang.org/cl/6458158

12 years agonet/http: fix send on close channel error
Dave Cheney [Tue, 21 Aug 2012 01:18:16 +0000 (11:18 +1000)]
net/http: fix send on close channel error

Fixes #3793.

Tested using GOMAXPROCS=81 which was able to trigger a panic
in TestStressSurpriseServerCloses continually on a Core i5.

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

12 years agoos: fix data race on Process.done
Dave Cheney [Tue, 21 Aug 2012 00:41:31 +0000 (10:41 +1000)]
os: fix data race on Process.done

Fixes #3969.

R=dvyukov, r, alex.brainman, minux.ma
CC=golang-dev
https://golang.org/cl/6462081

12 years agonet: add TCP benchmarks
Dmitriy Vyukov [Mon, 20 Aug 2012 17:27:52 +0000 (21:27 +0400)]
net: add TCP benchmarks
Current results on linux_amd64, 8 HT cores @2.4GHz:
BenchmarkTCPOneShot    10000     194037 ns/op
BenchmarkTCPOneShot-2    20000      93641 ns/op
BenchmarkTCPOneShot-4    20000      94039 ns/op
BenchmarkTCPOneShot-8    20000      94667 ns/op
BenchmarkTCPOneShot-16    10000     301924 ns/op
BenchmarkTCPOneShotTimeout    10000     193264 ns/op
BenchmarkTCPOneShotTimeout-2    20000      98247 ns/op
BenchmarkTCPOneShotTimeout-4    20000      94442 ns/op
BenchmarkTCPOneShotTimeout-8    20000      95297 ns/op
BenchmarkTCPOneShotTimeout-16    10000     307970 ns/op
BenchmarkTCPPersistent    50000      52050 ns/op
BenchmarkTCPPersistent-2   100000      29452 ns/op
BenchmarkTCPPersistent-4   100000      28823 ns/op
BenchmarkTCPPersistent-8    50000      30473 ns/op
BenchmarkTCPPersistent-16    10000     311777 ns/op
BenchmarkTCPPersistentTimeout    50000      32574 ns/op
BenchmarkTCPPersistentTimeout-2    50000      29723 ns/op
BenchmarkTCPPersistentTimeout-4   100000      28592 ns/op
BenchmarkTCPPersistentTimeout-8   100000      28997 ns/op
BenchmarkTCPPersistentTimeout-16    10000     314354 ns/op

R=golang-dev, alex.brainman, dave, mikioh.mikioh, r, iant, bradfitz, iant
CC=golang-dev
https://golang.org/cl/6458128

12 years agocmd/ld: skip R_*_NONE relocations, fix Linux/386 build again
Shenghou Ma [Mon, 20 Aug 2012 16:34:06 +0000 (00:34 +0800)]
cmd/ld: skip R_*_NONE relocations, fix Linux/386 build again
The last fix was wrong w.r.t C's operator precedence,
and it also failed to really skip the NONE relocation.

The offending R_386_NONE relocation is a absolute
relocation in section .eh_frame.

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

12 years agodoc/install: we only need command line tools for Xcode on OS X
Shenghou Ma [Mon, 20 Aug 2012 13:21:09 +0000 (21:21 +0800)]
doc/install: we only need command line tools for Xcode on OS X
     Fixes #3973.

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

12 years agostrconv: consistent parameter names for ParseUint
Volker Dobler [Mon, 20 Aug 2012 12:30:04 +0000 (22:30 +1000)]
strconv: consistent parameter names for ParseUint

If ParseUint is like ParseInt it should have the same parameter
names, thus rename b to to base as in ParseInt's documentation.

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

12 years agonet/http: reduce mutex contention
Dmitriy Vyukov [Mon, 20 Aug 2012 09:28:27 +0000 (13:28 +0400)]
net/http: reduce mutex contention
benchmark                           old ns/op    new ns/op    delta
BenchmarkClientServerParallel          155909       154454   -0.93%
BenchmarkClientServerParallel-2         86012        82986   -3.52%
BenchmarkClientServerParallel-4         70211        55168  -21.43%
BenchmarkClientServerParallel-8         80755        47862  -40.73%
BenchmarkClientServerParallel-12        77753        51478  -33.79%
BenchmarkClientServerParallel-16        77920        50278  -35.47%
The benchmark is https://golang.org/cl/6441134
The machine is 2 x 4 HT cores (16 HW threads total).
Fixes #3946.
Now contention moves to net.pollServer.AddFD().

R=bradfitz
CC=bradfitz, dave, dsymonds, gobot, golang-dev, remyoudompheng
https://golang.org/cl/6454142

12 years agoexp/locale/collate/build: fixed bug that was exposed by experimenting
Marcel van Lohuizen [Mon, 20 Aug 2012 08:56:41 +0000 (10:56 +0200)]
exp/locale/collate/build: fixed bug that was exposed by experimenting
with table changes.
NOTE: there is no test for this, but 1) the code has now the same
control flow as scan in exp/locale/collate/contract.go, which is
tested and 2) Builder verifies the generated table so bugs in this
code are quickly and easily found (which is how this bug was discovered).

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

12 years agoexp/locale/collate: let regtest generate its own collation table.
Marcel van Lohuizen [Mon, 20 Aug 2012 08:56:19 +0000 (10:56 +0200)]
exp/locale/collate: let regtest generate its own collation table.
The main table will need to get a slightly different collation table as the one
used by regtest, as the regtest is based on the standard UCA DUCET, while
the locale-specific tables are all based on a CLDR root table.
This change allows changing the table without affecting the regression test.

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

12 years agoexp/locale/collate: changed default AlternateHandling to non-ignorable, the same
Marcel van Lohuizen [Mon, 20 Aug 2012 08:56:06 +0000 (10:56 +0200)]
exp/locale/collate: changed default AlternateHandling to non-ignorable, the same
default as ICU.

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

12 years agoexp/locale/collate: Added test flag to maketables tool for comparing newly
Marcel van Lohuizen [Mon, 20 Aug 2012 08:55:40 +0000 (10:55 +0200)]
exp/locale/collate: Added test flag to maketables tool for comparing newly
against previously generated tables.

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

12 years agoexp/html: make the parser manipulate the tokenizer via exported methods
Nigel Tao [Mon, 20 Aug 2012 01:04:36 +0000 (11:04 +1000)]
exp/html: make the parser manipulate the tokenizer via exported methods
instead of touching the tokenizer's internal state.

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

12 years agocrypto/tls: explicitly require ExtKeyUsageClientAuth for client certs
Mikkel Krautz [Sat, 18 Aug 2012 22:50:33 +0000 (15:50 -0700)]
crypto/tls: explicitly require ExtKeyUsageClientAuth for client certs

If we aren't explicit about the KeyUsages, the verifier
will treat the certificate as a server certificate and require
it to have a ExtKeyUsageServerAuth key usage.

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

12 years agopprof: make it work on windows again
Alex Brainman [Sat, 18 Aug 2012 07:03:32 +0000 (17:03 +1000)]
pprof: make it work on windows again

- pprof is a perl script, so go command should invoke
  perl instead of trying to run pprof directly;
- pprof should use "go tool nm" unconditionally on windows,
  no one else can extract symbols from Go program;
- pprof should use "go tool nm" instead of "6nm".

Fixes #3879.

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

12 years agofmt: honor integer radix formats (%d etc.) for pointers
Rob Pike [Fri, 17 Aug 2012 23:12:25 +0000 (16:12 -0700)]
fmt: honor integer radix formats (%d etc.) for pointers
Before, pointers always appeared as 0x1234ABCD. This CL
keeps that as the default for %p and %v, but lets explicit
numeric verbs override the default.
Fixes #3936.

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

12 years agoall: move defers to after error check to avoid nil indirection
Rob Pike [Fri, 17 Aug 2012 18:55:11 +0000 (11:55 -0700)]
all: move defers to after error check to avoid nil indirection
Only affects some tests and none seem likely to be problematic, but let's fix them.
Fixes #3971.

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

12 years agogo_spec: unary + and - are also defined for complex types
Robert Griesemer [Fri, 17 Aug 2012 18:36:21 +0000 (11:36 -0700)]
go_spec: unary + and - are also defined for complex types

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

12 years agoruntime: fix netbsd/386 stack pointer handling
Joel Sing [Fri, 17 Aug 2012 11:53:02 +0000 (21:53 +1000)]
runtime: fix netbsd/386 stack pointer handling

When manipulating the stack pointer use the UESP register instead
of the ESP register, since the UESP register is the one that gets
restored from the machine context. Fixes broken tests on netbsd/386.

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

12 years agomisc/cgo/test: disable test on windows (attempt to fix windows build)
Alex Brainman [Fri, 17 Aug 2012 04:15:01 +0000 (14:15 +1000)]
misc/cgo/test: disable test on windows (attempt to fix windows build)

see issus 3358 for similar problem

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

12 years agocmd/ld: explicitly ignore R_*_NONE relocation to fix build
Shenghou Ma [Fri, 17 Aug 2012 01:11:58 +0000 (09:11 +0800)]
cmd/ld: explicitly ignore R_*_NONE relocation to fix build
        I don't know why this relocation is used.

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

12 years agomisc/cgo/life: remove -lmsvcrt to fix windows/amd64 build
Shenghou Ma [Fri, 17 Aug 2012 01:10:01 +0000 (09:10 +0800)]
misc/cgo/life: remove -lmsvcrt to fix windows/amd64 build
        I guess this is the problem as I can't reproduce the failure.

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

12 years agocmd/go: new cgo build procedure
Shenghou Ma [Thu, 16 Aug 2012 19:42:34 +0000 (03:42 +0800)]
cmd/go: new cgo build procedure
   This CL adds a step to the build procedure for cgo programs. It uses 'ld -r'
to combine all gcc compiled object file and generate a relocatable object file
for our ld. Additionally, this linking step will combine some static linking
gcc library into the relocatable object file, so that we can use libgcc,
libmingwex and libmingw32 without problem.

   Fixes #3261.
   Fixes #1741.
   Added a testcase for linking in libgcc.

TODO:
1. still need to fix the INDIRECT_SYMBOL_LOCAL problem on Darwin/386.
2. still need to enable the libgcc test on Linux/ARM, because 5l can't deal
with thumb libgcc.

Tested on Darwin/amd64, Darwin/386, FreeBSD/amd64, FreeBSD/386, Linux/amd64,
Linux/386, Linux/ARM, Windows/amd64, Windows/386

R=iant, rsc, bradfitz, coldredlemur
CC=golang-dev
https://golang.org/cl/5822049

12 years agomisc/cgo/test: remove unused Makefile
Dave Cheney [Thu, 16 Aug 2012 10:19:54 +0000 (20:19 +1000)]
misc/cgo/test: remove unused Makefile

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

12 years agotest: change run.go to ignore \r in compiler output (fixes windows build)
Alex Brainman [Thu, 16 Aug 2012 06:46:59 +0000 (16:46 +1000)]
test: change run.go to ignore \r in compiler output (fixes windows build)

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

12 years agocmd/gc: Don't claim type assertion would help when it wont.
Daniel Morsing [Wed, 15 Aug 2012 23:53:06 +0000 (16:53 -0700)]
cmd/gc: Don't claim type assertion would help when it wont.

Fixes #3465.

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

12 years agoexp/html: simplify testing code
Andrew Balholm [Wed, 15 Aug 2012 23:31:22 +0000 (09:31 +1000)]
exp/html: simplify testing code

Now that the parser passes all tests in the test suite,
it is no longer necessary to keep track of which tests
pass and which don't. So remove the testlogs directory
and the code that uses it.

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

12 years agoA+C: Andrew Lutomirski (individual CLA)
Ian Lance Taylor [Wed, 15 Aug 2012 21:44:17 +0000 (14:44 -0700)]
A+C: Andrew Lutomirski (individual CLA)

Wrote code that was the basis for
https://golang.org/cl/6454046/

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

12 years agotext/scanner: report illegal hexadecimal numbers (bug fix)
Robert Griesemer [Wed, 15 Aug 2012 18:09:34 +0000 (11:09 -0700)]
text/scanner: report illegal hexadecimal numbers (bug fix)

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

12 years agoos/exec: disable additional file descriptor test on netbsd
Joel Sing [Wed, 15 Aug 2012 16:06:21 +0000 (02:06 +1000)]
os/exec: disable additional file descriptor test on netbsd

This currently fails on NetBSD due to the cloned file descriptors
that result from opening /dev/urandom. Disable the additional checking
until this is investigated and properly fixed.

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

12 years agoruntime: disable crash handler test on netbsd
Joel Sing [Wed, 15 Aug 2012 16:02:00 +0000 (02:02 +1000)]
runtime: disable crash handler test on netbsd

Disable the crash handler test on NetBSD until I can figure out why
it triggers failures in later tests.

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

12 years agonet: implement netbsd sockoptip
Joel Sing [Wed, 15 Aug 2012 14:44:20 +0000 (00:44 +1000)]
net: implement netbsd sockoptip

Provide sockoptip for NetBSD, based on sockoptip for OpenBSD.

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

12 years agocmd/go: skipping relative paths on go test -i ./...
Francisco Souza [Wed, 15 Aug 2012 14:32:49 +0000 (07:32 -0700)]
cmd/go: skipping relative paths on go test -i ./...

Fixes #3896.

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

12 years agoexp/html: skip render and reparse on more tests that build badly-formed parse trees
Andrew Balholm [Wed, 15 Aug 2012 01:44:25 +0000 (11:44 +1000)]
exp/html: skip render and reparse on more tests that build badly-formed parse trees

All of the remaining tests that had as status of PARSE rather than PASS had
good reasons for not passing the render-and-reparse step: the correct parse tree is
badly formed, so when it is rendered out as HTML, the result doesn't parse into the
same tree. So add them to the list of tests where that step is skipped.

Also, I discovered that it is possible to end up with HTML elements (not just text)
inside a raw text element through reparenting. So change the rendering routines to
handle that situation as sensibly as possible (which still isn't very sensible, but
this is HTML5).

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

12 years ago5l: trivial whitespace cleanup
Robert Hencke [Wed, 15 Aug 2012 00:32:44 +0000 (10:32 +1000)]
5l: trivial whitespace cleanup

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

12 years agoapi: add recent API additions to next.txt
Benny Siegert [Wed, 15 Aug 2012 00:30:20 +0000 (10:30 +1000)]
api: add recent API additions to next.txt

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

12 years agogo/scanner: faster scanning
Robert Griesemer [Tue, 14 Aug 2012 18:26:30 +0000 (11:26 -0700)]
go/scanner: faster scanning

Optimize some common cases.

benchmark            old ns/op    new ns/op    delta
BenchmarkScanFile       718907       667960   -7.09%

benchmark             old MB/s     new MB/s  speedup
BenchmarkScanFile        23.03        25.51    1.11x

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

12 years agoexp/proxy: remove package.
Adam Langley [Tue, 14 Aug 2012 17:04:14 +0000 (13:04 -0400)]
exp/proxy: remove package.

This package has moved to go.net.

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

12 years agoexp/html: generate replacement for <isindex> correctly
Andrew Balholm [Mon, 13 Aug 2012 23:53:10 +0000 (09:53 +1000)]
exp/html: generate replacement for <isindex> correctly

When generating replacement elements for an <isindex> tag, the old
addSyntheticElement method was producing the wrong nesting. Replace
it with parseImpliedToken.

Pass the one remaining test in the test suite.

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

12 years agonet: remove unused fields
Dmitriy Vyukov [Mon, 13 Aug 2012 21:57:24 +0000 (01:57 +0400)]
net: remove unused fields

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

12 years agoruntime/pprof: fix comments
Dmitriy Vyukov [Mon, 13 Aug 2012 21:51:42 +0000 (01:51 +0400)]
runtime/pprof: fix comments

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

12 years agoexp/html: discard tags that are terminated by EOF instead of by '>'
Andrew Balholm [Mon, 13 Aug 2012 02:07:44 +0000 (12:07 +1000)]
exp/html: discard tags that are terminated by EOF instead of by '>'

If a tag doesn't have a closing '>', it isn't considered a tag;
it is just ignored and EOF is returned instead.

Pass one additional test in the test suite.

Change tokenizer tests to match correct behavior.

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

12 years agogo/parser: exit early if source file does not contain text
Robert Griesemer [Sun, 12 Aug 2012 04:06:40 +0000 (21:06 -0700)]
go/parser: exit early if source file does not contain text

Partial fix for issue 3943.

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

12 years agotext/template/parse: fix bug handling /*/
Rob Pike [Fri, 10 Aug 2012 02:24:46 +0000 (19:24 -0700)]
text/template/parse: fix bug handling /*/
Incorrect syntax for comment was erroneously accepted.
Fixes #3919.

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

12 years agoruntime: use sched_getaffinity for runtime.NumCPU() on Linux
Shenghou Ma [Fri, 10 Aug 2012 02:05:26 +0000 (10:05 +0800)]
runtime: use sched_getaffinity for runtime.NumCPU() on Linux
        Fixes #3921.

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

12 years agoexp/html: ignore self-closing flag except in SVG and MathML
Andrew Balholm [Thu, 9 Aug 2012 23:34:10 +0000 (09:34 +1000)]
exp/html: ignore self-closing flag except in SVG and MathML

In HTML content, having a self-closing tag is a parse error unless
the tag would be self-closing anyway (like <img>). The only place a
self-closing tag actually makes a difference is in XML-based foreign
content.

Pass 1 additional test.

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

12 years agogodoc: report error for directories with multiple packages
Robert Griesemer [Thu, 9 Aug 2012 23:10:46 +0000 (16:10 -0700)]
godoc: report error for directories with multiple packages

Fixes #3922.

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

12 years agogo/build: correct shouldBuild bug reading whole contents of file.
Rémy Oudompheng [Thu, 9 Aug 2012 21:22:51 +0000 (23:22 +0200)]
go/build: correct shouldBuild bug reading whole contents of file.

It was caused by bytes.TrimSpace being able to return a nil
slice.

Fixes #3914.

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

12 years agoexp/types: add more import tests
Robert Griesemer [Thu, 9 Aug 2012 18:55:00 +0000 (11:55 -0700)]
exp/types: add more import tests

Also simplified parsing of interface
types since they can only contain
methods (and no embedded interfaces)
in the export data.

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

12 years agospec: clarify evaluation order
Robert Griesemer [Thu, 9 Aug 2012 18:50:16 +0000 (11:50 -0700)]
spec: clarify evaluation order

Fixes #3852.

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

12 years agotesting: add Verbose() to expose whether -test.v is set
Shenghou Ma [Thu, 9 Aug 2012 15:41:09 +0000 (23:41 +0800)]
testing: add Verbose() to expose whether -test.v is set
    Fixes #3350.

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

12 years agomisc/cgo/life: explicitly specify library for assert function (fixes windows/amd64...
Alex Brainman [Thu, 9 Aug 2012 07:00:31 +0000 (17:00 +1000)]
misc/cgo/life: explicitly specify library for assert function (fixes windows/amd64 build)

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

12 years agotext/template: add 'nil' as a keyword in the language
Rob Pike [Thu, 9 Aug 2012 03:02:19 +0000 (20:02 -0700)]
text/template: add 'nil' as a keyword in the language
The keyword reprents an untyped nil and is useful for
passing nil values to methods and functions. The
nil will be promoted to the appropriate type when
used; if a type cannot be assigned, an error results.

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

12 years agocmd/5l: add PT_PAX_FLAGS ELF header
Shenghou Ma [Thu, 9 Aug 2012 00:47:43 +0000 (08:47 +0800)]
cmd/5l: add PT_PAX_FLAGS ELF header
Although I don't use PAX enabled ARM kernels, PAX
does have support for ARM, so we're better off add
PT_PAX_FLAGS now in case people use PAX kernels.

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

12 years agoexp/html: ignore </html> in afterBodyIM when parsing a fragment
Andrew Balholm [Thu, 9 Aug 2012 00:19:25 +0000 (10:19 +1000)]
exp/html: ignore </html> in afterBodyIM when parsing a fragment

Pass 1 additional test.

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

12 years agoexp/html: when ignoring <textarea> tag, switch tokenizer out of raw text mode
Andrew Balholm [Wed, 8 Aug 2012 23:43:10 +0000 (09:43 +1000)]
exp/html: when ignoring <textarea> tag, switch tokenizer out of raw text mode

Pass 1 additional test.

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

12 years agomath: update definition of NaN in assembly language files
Charles L. Dorian [Wed, 8 Aug 2012 23:40:05 +0000 (09:40 +1000)]
math: update definition of NaN in assembly language files

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

12 years ago doc: add 'Get Started with Go' video, remove some older videos
Andrew Gerrand [Wed, 8 Aug 2012 22:50:13 +0000 (08:50 +1000)]
  doc: add 'Get Started with Go' video, remove some older videos

(I also updated the wiki's GoTalks page with all the latest videos.)

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

12 years agoall: make Unicode surrogate halves illegal as UTF-8
Rob Pike [Wed, 8 Aug 2012 21:01:23 +0000 (14:01 -0700)]
all: make Unicode surrogate halves illegal as UTF-8

Surrogate halves are part of UTF-16 and should never appear in UTF-8.
(The rune that two combined halves represent in UTF-16 should
be encoded directly.)

Encoding: encode as RuneError.
Decoding: convert to RuneError, consume one byte.

This requires changing:
        package unicode/utf8
        runtime for range over string
Also added utf8.ValidRune and fixed bug in utf.RuneLen.

Fixes #3927.

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

12 years agoio: amend ReaderFrom doc as per r's comment
Andrew Gerrand [Wed, 8 Aug 2012 05:41:47 +0000 (15:41 +1000)]
io: amend ReaderFrom doc as per r's comment

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

12 years agomisc/dashboard/codereview: fixes for non-reviewers.
David Symonds [Wed, 8 Aug 2012 03:16:21 +0000 (13:16 +1000)]
misc/dashboard/codereview: fixes for non-reviewers.

Also rename the testing CGI argument from "email" to "user".

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

12 years agocrypto/rand: Example for Read.
Yves Junqueira [Wed, 8 Aug 2012 02:04:54 +0000 (12:04 +1000)]
crypto/rand: Example for Read.

R=adg, remyoudompheng, rsc, r
CC=golang-dev
https://golang.org/cl/6457085

12 years agomisc/dashboard/codereview: fix obo
Russ Cox [Wed, 8 Aug 2012 01:04:57 +0000 (11:04 +1000)]
misc/dashboard/codereview: fix obo

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

12 years agogodoc: make id attributes unique
Robert Griesemer [Wed, 8 Aug 2012 00:45:58 +0000 (17:45 -0700)]
godoc: make id attributes unique

Some browsers (e.g. IE9) ignore the case of 'id' attributes
which can lead to conflicts. Prefix non-generated 'id's with
"pkg-" to make them different from any generated attribute.

Also: Added missing entry for "Other packages" to top-level
index.

Fixes #3851.

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

12 years agoexp/html: foster-parent text correctly
Andrew Balholm [Wed, 8 Aug 2012 00:00:57 +0000 (10:00 +1000)]
exp/html: foster-parent text correctly

If a table contained whitespace, text nodes would not get foster parented
correctly.

Pass 1 additional test.

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

12 years agoimage/jpeg: send a correct Start Of Scan (SOS) header.
Nigel Tao [Tue, 7 Aug 2012 23:57:09 +0000 (09:57 +1000)]
image/jpeg: send a correct Start Of Scan (SOS) header.

Section B.2.3 of http://www.w3.org/Graphics/JPEG/itu-t81.pdf discusses
the End of spectral selection (Se) byte.

Apparently many JPEG decoders ignore the Se byte (or let it through
with a warning), but some configurations reject them. For example,
http://download.blender.org/source/chest/blender_2.03_tree/jpeg/jcmaster.c
has these lines:

if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0)
  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);

Fixes #3916.

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

12 years agoruntime: inline several float64 routines to speed up complex128 division
Shenghou Ma [Tue, 7 Aug 2012 15:45:50 +0000 (23:45 +0800)]
runtime: inline several float64 routines to speed up complex128 division
Depends on CL 6197045.

Result obtained on Core i7 620M, Darwin/amd64:
benchmark                       old ns/op    new ns/op    delta
BenchmarkComplex128DivNormal           57           28  -50.78%
BenchmarkComplex128DivNisNaN           49           15  -68.90%
BenchmarkComplex128DivDisNaN           49           15  -67.88%
BenchmarkComplex128DivNisInf           40           12  -68.50%
BenchmarkComplex128DivDisInf           33           13  -61.06%

Result obtained on Core i7 620M, Darwin/386:
benchmark                       old ns/op    new ns/op    delta
BenchmarkComplex128DivNormal           89           50  -44.05%
BenchmarkComplex128DivNisNaN          307          802  +161.24%
BenchmarkComplex128DivDisNaN          309          788  +155.02%
BenchmarkComplex128DivNisInf          278          237  -14.75%
BenchmarkComplex128DivDisInf           46           22  -52.46%

Result obtained on 700MHz OMAP4460, Linux/ARM:
benchmark                       old ns/op    new ns/op    delta
BenchmarkComplex128DivNormal         1557          465  -70.13%
BenchmarkComplex128DivNisNaN         1443          220  -84.75%
BenchmarkComplex128DivDisNaN         1481          218  -85.28%
BenchmarkComplex128DivNisInf          952          216  -77.31%
BenchmarkComplex128DivDisInf          861          231  -73.17%

The 386 version has a performance regression, but as we have
decided to use SSE2 instead of x87 FPU for 386 too (issue 3912),
I won't address this issue.

R=dsymonds, mchaten, iant, dave, mtj, rsc, r
CC=golang-dev
https://golang.org/cl/6024045

12 years agoio: document ReaderFrom and WriterTo
Brad Fitzpatrick [Tue, 7 Aug 2012 06:10:10 +0000 (16:10 +1000)]
io: document ReaderFrom and WriterTo

Fixes #3711

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

12 years agotext/template: fix range example.
Yves Junqueira [Tue, 7 Aug 2012 03:40:43 +0000 (20:40 -0700)]
text/template: fix range example.

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

12 years agoexp/html: correctly handle <title> after </head>
Andrew Balholm [Tue, 7 Aug 2012 03:36:08 +0000 (13:36 +1000)]
exp/html: correctly handle <title> after </head>

The <title> element was getting removed from the stack of open elements,
when its parent, the <head> element should have been removed instead.

Pass 2 additional tests.

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

12 years agonet/http: disable TestServeFileFromCWD test on windows
Alex Brainman [Tue, 7 Aug 2012 03:19:49 +0000 (13:19 +1000)]
net/http: disable TestServeFileFromCWD test on windows

This is an attempt to fix windows build. Will restore
once we know what the problem is.

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

12 years agodoc: fix some HTML syntax errors
Shenghou Ma [Tue, 7 Aug 2012 03:12:54 +0000 (11:12 +0800)]
doc: fix some HTML syntax errors

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

12 years agocmd/5l: dwarf line number support for Linux/ARM
Shenghou Ma [Tue, 7 Aug 2012 02:09:24 +0000 (10:09 +0800)]
cmd/5l: dwarf line number support for Linux/ARM
   Part of issue 3747.

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

12 years agocmd/go: remove $WORK paths in generated binaries
Shenghou Ma [Tue, 7 Aug 2012 02:00:58 +0000 (10:00 +0800)]
cmd/go: remove $WORK paths in generated binaries
        Fixes #3748.

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

12 years agomath, runtime: use a NaN that matches gcc's
Shenghou Ma [Tue, 7 Aug 2012 01:57:14 +0000 (09:57 +0800)]
math, runtime: use a NaN that matches gcc's
        our old choice is not working properly at least on VFPv2 in
ARM1136JF-S (it's not preserved across float64->float32 conversions).

        Fixes #3745.

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

12 years agoruntime: remove unnecessary ROUND in alg.c
Shenghou Ma [Tue, 7 Aug 2012 01:49:56 +0000 (09:49 +0800)]
runtime: remove unnecessary ROUND in alg.c
        Introduced in CL 6452046.

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

12 years agomisc/cgo/{life,stdio}, test/run.go: use test/run.go to do the cgo tests
Shenghou Ma [Tue, 7 Aug 2012 01:38:35 +0000 (09:38 +0800)]
misc/cgo/{life,stdio}, test/run.go: use test/run.go to do the cgo tests
   Enhances test/run.go to support testing other directories
   Will enable stdio tests on Windows in a follow-up CL.

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

12 years agoexp/html: fix foster-parenting when elements are implicitly closed
Andrew Balholm [Mon, 6 Aug 2012 23:35:09 +0000 (09:35 +1000)]
exp/html: fix foster-parenting when elements are implicitly closed

When an element (like <nobr> or <p>) was implicitly closed by another
start tag, it would keep foster parenting from working because
the check for what was on top of the stack of open elements was
in the wrong place.

Move the check to addChild.

Pass 2 additional tests.

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

12 years agonet: fix spurious EADDRNOTAVAIL errors
Russ Cox [Mon, 6 Aug 2012 20:32:00 +0000 (16:32 -0400)]
net: fix spurious EADDRNOTAVAIL errors

R=golang-dev, fullung
CC=golang-dev
https://golang.org/cl/6443085

12 years agosyscall: fix plan9 build broken by CL 6458050
Alexey Borzenkov [Mon, 6 Aug 2012 20:24:08 +0000 (16:24 -0400)]
syscall: fix plan9 build broken by CL 6458050

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

12 years agotest/run: ignore all but .go file during compiledir action
Alex Brainman [Mon, 6 Aug 2012 04:56:39 +0000 (14:56 +1000)]
test/run: ignore all but .go file during compiledir action

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

12 years agonet: fix TCPListener file leak to child processes
Brad Fitzpatrick [Mon, 6 Aug 2012 04:12:23 +0000 (14:12 +1000)]
net: fix TCPListener file leak to child processes

Hold ForkLock during dup of fd + cloexec in the net pkg,
per the locking policy documented in syscall/exec_unix.go.

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

12 years agosyscall: return EINVAL when string arguments have NUL characters
Alexey Borzenkov [Sun, 5 Aug 2012 21:24:32 +0000 (17:24 -0400)]
syscall: return EINVAL when string arguments have NUL characters

Since NUL usually terminates strings in underlying syscalls, allowing
it when converting string arguments is a security risk, especially
when dealing with filenames. For example, a program might reason that
filename like "/root/..\x00/" is a subdirectory or "/root/" and allow
access to it, while underlying syscall will treat "\x00" as an end of
that string and the actual filename will be "/root/..", which might
be unexpected. Returning EINVAL when string arguments have NUL in
them makes sure this attack vector is unusable.

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

12 years agosyscall: add some new syscall numbers from NetBSD-current
Benny Siegert [Sun, 5 Aug 2012 21:02:41 +0000 (17:02 -0400)]
syscall: add some new syscall numbers from NetBSD-current

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

12 years agoruntime: faster string equality.
Rémy Oudompheng [Sun, 5 Aug 2012 19:35:41 +0000 (21:35 +0200)]
runtime: faster string equality.

benchmark                                old ns/op    new ns/op    delta
BenchmarkCompareStringEqual                     51           35  -30.20%
BenchmarkCompareStringIdentical                 51            7  -85.71%
BenchmarkCompareStringSameLength                25           18  -28.29%
BenchmarkCompareStringDifferentLength            2            2   +1.46%

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

12 years agomisc/dashboard/codereview: show first line of last message in thread
Russ Cox [Sun, 5 Aug 2012 18:35:35 +0000 (14:35 -0400)]
misc/dashboard/codereview: show first line of last message in thread

This line helps me to tell whether the CL is waiting for me or I'm waiting for the author.

Also:
 - vertical-align table cells so buttons are always aligned with CL headers.
 - add email= to show front page for someone else.

 Demo at http://rsc.gocodereview.appspot.com/.
 Until this is deployed for real, some recently changed CLs may be
 missing the 'first line of last message' part.

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

12 years agobufio: discourage use of ReadLine
Russ Cox [Sun, 5 Aug 2012 18:32:09 +0000 (14:32 -0400)]
bufio: discourage use of ReadLine

Too many people use it without reading what it does.
Those people want ReadBytes or ReadString.

Fixes #3906.

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

12 years agostrconv: speedup AppendFloat/FormatFloat.
Rémy Oudompheng [Sun, 5 Aug 2012 18:30:13 +0000 (20:30 +0200)]
strconv: speedup AppendFloat/FormatFloat.

The improvement is obtained by eliminating the zero
initialization of a large structure that is only
needed when the fast path fails.

Also add a missing roundtrip test for float32s.

benchmark                              old ns/op    new ns/op    delta
BenchmarkAppendFloatDecimal                  301          180  -40.20%
BenchmarkAppendFloat                         486          388  -20.16%
BenchmarkAppendFloatExp                      492          383  -22.15%
BenchmarkAppendFloatNegExp                   478          370  -22.59%
BenchmarkAppendFloatBig                      650          541  -16.77%
BenchmarkAppendFloat32Integer                308          180  -41.56%
BenchmarkAppendFloat32ExactFraction          449          333  -25.84%
BenchmarkAppendFloat32Point                  494          390  -21.05%
BenchmarkAppendFloat32Exp                    488          387  -20.70%
BenchmarkAppendFloat32NegExp                 488          378  -22.54%

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

12 years agoexp/html: don't treat SVG <title> like HTML <title>
Andrew Balholm [Sun, 5 Aug 2012 12:32:35 +0000 (22:32 +1000)]
exp/html: don't treat SVG <title> like HTML <title>

The content of an HTML <title> element is RCDATA, but the content of an SVG
<title> element is parsed as tags. Now the parser doesn't go into RCDATA
mode in foreign content.

Pass 4 additional tests.

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

12 years agocmd/go: allow to use syso files with cgo
Dmitriy Vyukov [Sat, 4 Aug 2012 15:02:12 +0000 (18:02 +0300)]
cmd/go: allow to use syso files with cgo
I have C functions implemented in .syso file (rather than .so or inlined in .go file).
W/o this change the gcc invocation fails with undefined symbols.

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

12 years agocmd/cc: allow to call nested packages from within C code
Dmitriy Vyukov [Sat, 4 Aug 2012 12:11:53 +0000 (16:11 +0400)]
cmd/cc: allow to call nested packages from within C code
E.g. sync/atomic.LoadInt32() can be called as sync»atomic·LoadInt32()

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

12 years agocmd/go, go/build, misc/swig: add SWIG support to Go tool
Ian Lance Taylor [Sat, 4 Aug 2012 01:08:43 +0000 (18:08 -0700)]
cmd/go, go/build, misc/swig: add SWIG support to Go tool

R=adg, rsc, franciscossouza, seb.binet, gen.battle
CC=golang-dev
https://golang.org/cl/5845071

12 years ago5a, 5l, math: Add support for ABSD, ABSF floating point instructions.
Michał Derkacz [Fri, 3 Aug 2012 20:15:11 +0000 (16:15 -0400)]
5a, 5l, math: Add support for ABSD, ABSF floating point instructions.

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