]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years ago6l/5l: PIC and shared library support for the linkers.
Elias Naur [Wed, 30 Jan 2013 16:46:56 +0000 (08:46 -0800)]
6l/5l: PIC and shared library support for the linkers.

Added the -shared flag to 5l/6l to output a PIC executable with the required
dynamic relocations and RIP-relative addressing in machine code.
Added dummy support to 8l to avoid compilation errors

See also:
https://golang.org/cl/6822078
https://golang.org/cl/7064048

and

https://groups.google.com/d/topic/golang-nuts/P05BDjLcQ5k/discussion

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

12 years agocmd/dist: fix code example in README
Russ Cox [Wed, 30 Jan 2013 16:46:50 +0000 (08:46 -0800)]
cmd/dist: fix code example in README

Fixes #4729.

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

12 years agoA+C: Elias Naur (individual CLA)
Russ Cox [Wed, 30 Jan 2013 16:46:40 +0000 (08:46 -0800)]
A+C: Elias Naur (individual CLA)

Generated by addca.

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

12 years agocmd/cgo: allow for stdcall decorated dynimport names
James Gray [Wed, 30 Jan 2013 16:29:33 +0000 (08:29 -0800)]
cmd/cgo: allow for stdcall decorated dynimport names

To allow for stdcall decorated names on Windows, two changes were needed:
1. Change the symbol versioning delimiter '@' in cgo's dynimport output to a '#', and in cmd/ld when it parses dynimports.
2. Remove the "@N" decorator from the first argument of cgo's dynimport output (PE only).

Fixes #4607.

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

12 years agocrypto/rc4: add simple amd64 asm implementation.
Adam Langley [Wed, 30 Jan 2013 16:01:19 +0000 (11:01 -0500)]
crypto/rc4: add simple amd64 asm implementation.

(Although it's still half the speed of OpenSSL.)

benchmark           old ns/op    new ns/op    delta
BenchmarkRC4_128         1409          398  -71.75%
BenchmarkRC4_1K         10920         2898  -73.46%
BenchmarkRC4_8K        131323        23083  -82.42%

benchmark            old MB/s     new MB/s  speedup
BenchmarkRC4_128        90.83       321.43    3.54x
BenchmarkRC4_1K         93.77       353.28    3.77x
BenchmarkRC4_8K         61.65       350.73    5.69x

R=rsc, remyoudompheng
CC=golang-dev, jgrahamc
https://golang.org/cl/7234055

12 years agoencoding/xml: add (*Encoder).Indent
Russ Cox [Wed, 30 Jan 2013 15:57:20 +0000 (07:57 -0800)]
encoding/xml: add (*Encoder).Indent

Exposing this on the Encoder allows streaming generation of indented XML.

R=golang-dev, rogpeppe
CC=golang-dev
https://golang.org/cl/7221075

12 years agocmd/vet: detect misuse of atomic.Add*
Rodrigo Rafael Monti Kochenburger [Wed, 30 Jan 2013 15:57:11 +0000 (07:57 -0800)]
cmd/vet: detect misuse of atomic.Add*

Re-assigning the return value of an atomic operation to the same variable being operated is a common mistake:

x = atomic.AddUint64(&x, 1)

Add this check to go vet.

Fixes #4065.

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

12 years agoinclude: Plan 9: hide any previous definition of Runemax
Akshat Kumar [Wed, 30 Jan 2013 15:56:08 +0000 (07:56 -0800)]
include: Plan 9: hide any previous definition of Runemax

Runemax is already defined in libc on 64-bit version of
Plan 9, but is not defined on other versions.
To accommodate, we make sure to rename any previous
instance of Runemax and re-define it subsequently.

R=rsc, ality, rminnich
CC=golang-dev
https://golang.org/cl/7232059

12 years agoruntime: add support for panic/recover in Plan 9 note handler
Akshat Kumar [Wed, 30 Jan 2013 10:53:56 +0000 (02:53 -0800)]
runtime: add support for panic/recover in Plan 9 note handler

This change also resolves some issues with note handling: we now make
sure that there is enough room at the bottom of every goroutine to
execute the note handler, and the `exitstatus' is no longer a global
entity, which resolves some race conditions.

R=rminnich, npe, rsc, ality
CC=golang-dev
https://golang.org/cl/6569068

12 years agoC: add Hossein Sheikh Attar (Google CLA)
Andrew Gerrand [Wed, 30 Jan 2013 06:26:22 +0000 (17:26 +1100)]
C: add Hossein Sheikh Attar (Google CLA)

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

12 years agoruntime: implement range access functions in race detector.
Rémy Oudompheng [Wed, 30 Jan 2013 00:55:02 +0000 (01:55 +0100)]
runtime: implement range access functions in race detector.

Range access functions are already available in TSan library
but were not yet used.

Time for go test -race -short:

Before:
compress/flate 24.244s
exp/norm       >200s
go/printer     78.268s

After:
compress/flate 17.760s
exp/norm        5.537s
go/printer      5.738s

Fixes #4250.

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

12 years agoA+C: Rodrigo Rafael Monti Kochenburger (individual CLA)
Russ Cox [Tue, 29 Jan 2013 23:26:42 +0000 (15:26 -0800)]
A+C: Rodrigo Rafael Monti Kochenburger (individual CLA)

Generated by addca.

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

12 years agogo/misc/dist: Keep file modes when copying.
Francesc Campoy [Tue, 29 Jan 2013 23:17:39 +0000 (15:17 -0800)]
go/misc/dist: Keep file modes when copying.

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

12 years agogo/build: clean up after rollback
Andrew Gerrand [Tue, 29 Jan 2013 22:10:58 +0000 (09:10 +1100)]
go/build: clean up after rollback

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

12 years agoencoding/json: add test for Unmarshal of malformed data
Russ Cox [Tue, 29 Jan 2013 21:34:18 +0000 (13:34 -0800)]
encoding/json: add test for Unmarshal of malformed data

Roll back CL making primitive type unmarshal faster,
because it broke the Unmarshal of malformed data.

Add benchmarks for unmarshal of primitive types.

Update #3949.

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

12 years agoruntime: clear up lr comments
Russ Cox [Tue, 29 Jan 2013 21:12:50 +0000 (13:12 -0800)]
runtime: clear up lr comments

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

12 years agocodereview: show 'not lgtms' in hg p output (with lgtms)
Russ Cox [Tue, 29 Jan 2013 17:32:49 +0000 (09:32 -0800)]
codereview: show 'not lgtms' in hg p output (with lgtms)

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

12 years agocmd/go: add helpful error message when vcs is not found.
Gustavo Franco [Tue, 29 Jan 2013 16:20:43 +0000 (08:20 -0800)]
cmd/go: add helpful error message when vcs is not found.
Fixes #4652.

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

12 years agoexp/ssa: make Parameters values, not addresses.
Alan Donovan [Tue, 29 Jan 2013 15:49:16 +0000 (10:49 -0500)]
exp/ssa: make Parameters values, not addresses.

We explicitly spill all parameters to the frame during initial
SSA construction.  (Later passes will remove spills.)
We now properly handle local Allocs escaping via Captures.

Also: allocate BasicBlock.Succs inline.

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

12 years agoruntime: dump the full stack of a throwing goroutine
Dmitriy Vyukov [Tue, 29 Jan 2013 10:57:11 +0000 (14:57 +0400)]
runtime: dump the full stack of a throwing goroutine
Useful for debugging of runtime bugs.
+ Do not print "stack segment boundary" unless GOTRACEBACK>1.
+ Do not traceback system goroutines unless GOTRACEBACK>1.

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

12 years agogo/misc: Adding go-tour to the generated packages for every distribution.
Francesc Campoy [Tue, 29 Jan 2013 05:46:49 +0000 (21:46 -0800)]
go/misc: Adding go-tour to the generated packages for every distribution.

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

12 years agocmd/gc: document more of the declaration context enumeration
Carl Shapiro [Tue, 29 Jan 2013 00:57:36 +0000 (16:57 -0800)]
cmd/gc: document more of the declaration context enumeration

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

12 years agocmd/api: normalize byte to uint8 and rune to int32
Brad Fitzpatrick [Tue, 29 Jan 2013 00:45:45 +0000 (16:45 -0800)]
cmd/api: normalize byte to uint8 and rune to int32

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

12 years agoencoding/json: add Decoder.Buffered accessor to get overread data
Brad Fitzpatrick [Tue, 29 Jan 2013 00:31:46 +0000 (16:31 -0800)]
encoding/json: add Decoder.Buffered accessor to get overread data

Otherwise it's impossible to know how much data from the
json.Decoder's underlying Reader was actually consumed.

The old fix from golang.org/issue/1955 just added docs. This
provides an actual mechanism.

Update #1955

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

12 years agoexp/ssa: fix breakage due to https://code.google.com/p/go/source/detail?r=ca5e5de48173
Alan Donovan [Tue, 29 Jan 2013 00:21:25 +0000 (19:21 -0500)]
exp/ssa: fix breakage due to https://code.google.com/p/go/source/detail?r=ca5e5de48173

I don't understand why this didn't show up during my testing.

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

12 years agotest: add test case miscompiled by gccgo
Ian Lance Taylor [Tue, 29 Jan 2013 00:17:06 +0000 (16:17 -0800)]
test: add test case miscompiled by gccgo

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

12 years agocmd/ld: avoid a segfault when dumping the symbol table
Carl Shapiro [Mon, 28 Jan 2013 23:47:25 +0000 (15:47 -0800)]
cmd/ld: avoid a segfault when dumping the symbol table

The dumping routine incorrectly assumed that all incoming
symbols would be non-nil and load through it to retrieve the
symbol name.  Instead of using the symbol to retrieve a name,
use the name provided by the caller.

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

12 years agoexp/gotype: fix build breakage due to https://code.google.com/p/go/source/detail...
Alan Donovan [Mon, 28 Jan 2013 23:26:26 +0000 (18:26 -0500)]
exp/gotype: fix build breakage due to https://code.google.com/p/go/source/detail?r=ca5e5de48173

Add 'math/big' to blacklist of packages that use shift
operations as yet unsupported by go/types.

(The failure was masked due to local bugfixes in my client.)

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

12 years agoexp/ssa: (#3 of 5): Function, BasicBlock and optimisations
Alan Donovan [Mon, 28 Jan 2013 23:14:09 +0000 (18:14 -0500)]
exp/ssa: (#3 of 5): Function, BasicBlock and optimisations

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

12 years agoexp/ssa: (#2 of 5): core utilities
Alan Donovan [Mon, 28 Jan 2013 23:06:14 +0000 (18:06 -0500)]
exp/ssa: (#2 of 5): core utilities

This CL includes the implementation of Literal, all the
Value.String and Instruction.String methods, the sanity
checker, and other misc utilities.

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

12 years agomath/big: add Rat.{,Set}Float64 methods for IEEE 754 conversions.
Alan Donovan [Mon, 28 Jan 2013 23:00:15 +0000 (18:00 -0500)]
math/big: add Rat.{,Set}Float64 methods for IEEE 754 conversions.

Added tests, using input data from strconv.ParseFloat.
Thanks to rsc for most of the test code.

math/big could use some good package-level documentation.

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

12 years agotest: add support for build tags.
Rémy Oudompheng [Mon, 28 Jan 2013 20:29:45 +0000 (21:29 +0100)]
test: add support for build tags.

This enables a few tests that were only executed
unconditionnally.

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

12 years agoxml: differentiate between float32 and float64 for marshalSimple
Vega Garcia Luis Alfonso [Mon, 28 Jan 2013 17:54:27 +0000 (12:54 -0500)]
xml: differentiate between float32 and float64 for marshalSimple

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

12 years agoruntime: earlier detection of unused spans.
Sébastien Paolacci [Mon, 28 Jan 2013 17:53:35 +0000 (12:53 -0500)]
runtime: earlier detection of unused spans.

Mark candidate spans one GC pass earlier.

Move scavenger's code out from mgc0 and constrain it into mheap (where it belongs).

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

12 years agogo/build: undo CL 7129048
Russ Cox [Mon, 28 Jan 2013 17:49:26 +0000 (12:49 -0500)]
go/build: undo CL 7129048

This broke 'godoc net/http'.

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

12 years agonet: fix windows build
Ian Lance Taylor [Mon, 28 Jan 2013 17:37:10 +0000 (09:37 -0800)]
net: fix windows build

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

12 years agonet, syscall: use accept4 and SOCK_CLOEXEC on Linux
Ian Lance Taylor [Mon, 28 Jan 2013 16:54:15 +0000 (08:54 -0800)]
net, syscall: use accept4 and SOCK_CLOEXEC on Linux

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

12 years agosrc: add race.bash
Dave Cheney [Mon, 28 Jan 2013 10:05:25 +0000 (21:05 +1100)]
src: add race.bash

Add race.bash so anyone with suitable hardware can run a race detector build. race.bash can be called from the dashboard builder by passing -cmd="race.bash".

Original source for race.bash is here, http://code.google.com/p/go-wiki/wiki/DashboardBuilders

TODO: add race.bat for windows/amd64

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

12 years agogo/ast: Fix typo for the godoc of ObjKind
Vega Garcia Luis Alfonso [Mon, 28 Jan 2013 05:36:47 +0000 (21:36 -0800)]
go/ast: Fix typo for the godoc of ObjKind

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

12 years agoCONTRIBUTORS: Add Gustavo Franco (Google CLA)
Brad Fitzpatrick [Mon, 28 Jan 2013 00:32:21 +0000 (16:32 -0800)]
CONTRIBUTORS: Add Gustavo Franco (Google CLA)

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

12 years agoruntime: use new CNT_MASK in lfstack
Ian Lance Taylor [Sun, 27 Jan 2013 02:16:43 +0000 (18:16 -0800)]
runtime: use new CNT_MASK in lfstack

This is for SPARC64, a 64-bit processor that uses all 64-bits
of virtual addresses.  The idea is to use the low order 3 bits
to at least get a small ABA counter.  That should work since
pointers are aligned.  The idea is for SPARC64 to set CNT_MASK
== 7, PTR_BITS == 0, PTR_MASK == 0xffffffffffffff8.

Also add uintptr casts to avoid GCC warnings.  The gccgo
runtime code is compiled with GCC, and GCC warns when casting
between a pointer and a type of a different size.

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

12 years agoall: make tests able to run multiple times.
Rémy Oudompheng [Sat, 26 Jan 2013 23:24:09 +0000 (00:24 +0100)]
all: make tests able to run multiple times.

It is now possible to run "go test -cpu=1,2,4 std"
successfully.

Fixes #3185.

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

12 years agocmd/go: add missing tests
Dave Cheney [Sat, 26 Jan 2013 04:07:21 +0000 (23:07 -0500)]
cmd/go: add missing tests

These changes to test.bash were intended to be submitted with CL 6941058, but were accidentally excluded from the original CL.

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

12 years agoruntime: avoid defining the same variable in more than one translation unit
Shenghou Ma [Sat, 26 Jan 2013 01:57:06 +0000 (09:57 +0800)]
runtime: avoid defining the same variable in more than one translation unit
For gccgo runtime and Darwin where -fno-common is the default.

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

12 years agoCONTRIBUTORS: add Carl Shapiro's golang.org address
Brad Fitzpatrick [Fri, 25 Jan 2013 23:35:25 +0000 (15:35 -0800)]
CONTRIBUTORS: add Carl Shapiro's golang.org address

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

12 years agonet/http: fix Content-Length/Transfer-Encoding on HEAD requests
John Graham-Cumming [Fri, 25 Jan 2013 18:20:19 +0000 (10:20 -0800)]
net/http: fix Content-Length/Transfer-Encoding on HEAD requests

net/http currently assumes that the response to a HEAD request
    will always have a Content-Length header. This is incorrect.

RFC2616 says: "The HEAD method is identical to GET except that
the server MUST NOT return a message-body in the response. The
metainformation contained in the HTTP headers in response to a
HEAD request SHOULD be identical to the information sent in
response to a GET request. This method can be used for
obtaining metainformation about the entity implied by the
request without transferring the entity-body itself. This
method is often used for testing hypertext links for validity,
accessibility, and recent modification."

This means that three cases are possible: a Content-Length
header, a Transfer-Encoding header or neither. In the wild the
following sites exhibit these behaviours (curl -I):

HEAD on http://www.google.co.uk/ has Transfer-Encoding: chunked
HEAD on http://www.bbc.co.uk/    has Content-Length: 45247
HEAD on http://edition.cnn.com/  has neither header

This patch does not remove the ErrMissingContentLength error
for compatibility reasons, but it is no longer used.

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

12 years agomisc/dashboard/builder: synchronize accesses to goroot, always -commit
Andrew Gerrand [Thu, 24 Jan 2013 23:06:18 +0000 (10:06 +1100)]
misc/dashboard/builder: synchronize accesses to goroot, always -commit

This prevents the occasional issue when Mercurial screws up the locking
itself, and by moving the locking into this process we can use the
goroot for other things (such as automatically updating the builder
binary).

It also asks all builders to poll for new commits.

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

12 years agoexp/ssa: API and documentation.
Alan Donovan [Thu, 24 Jan 2013 22:21:48 +0000 (17:21 -0500)]
exp/ssa: API and documentation.

R=gri, iant, crawshaw, bradfitz, gri, iant
CC=golang-dev
https://golang.org/cl/7071058

12 years agodoc: add mention of the Go+ community
Andrew Gerrand [Thu, 24 Jan 2013 21:27:34 +0000 (08:27 +1100)]
doc: add mention of the Go+ community

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

12 years agogo/types: expose types.IsIdentical, the Type equivalence relation.
Alan Donovan [Thu, 24 Jan 2013 19:22:17 +0000 (14:22 -0500)]
go/types: expose types.IsIdentical, the Type equivalence relation.

This function is absolutely critical for clients such as
exp/ssa, and too complex for clients to duplicate.

As with CL 7200046, gri expressed in the doc below [gophers
only] before going on leave that he intended to expose such a
predicate, though his wording suggests as an interface method
of Type rather than a standalone function.  (My preference is
for binary methods to be standalone; see "On Binary Methods",
Kim Bruce, 1995).  In any case if he wishes to move it that's
easily accommodated by clients.

https://docs.google.com/a/google.com/document/d/1-DQ4fxlMDs9cYtnkKhAAehX6MArjOQyJsRXp-6kiJLA/edit#heading=h.k3bwja7xony9

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

12 years agogo/types: add String() method to Type interface.
Alan Donovan [Thu, 24 Jan 2013 19:21:51 +0000 (14:21 -0500)]
go/types: add String() method to Type interface.

All implementations delegate to typeString.

Though I don't wish to exploit gri's absence to change
his code, this change is pretty low-risk and he assented to it
in the blue ink in the doc below [gophers only].
https://docs.google.com/a/google.com/document/d/1-DQ4fxlMDs9cYtnkKhAAehX6MArjOQyJsRXp-6kiJLA/edit#

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

12 years agoruntime: increase stack limit in a test
Dmitriy Vyukov [Thu, 24 Jan 2013 16:26:08 +0000 (20:26 +0400)]
runtime: increase stack limit in a test
Otherwise the test is flaky.
Fixes #4698.

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

12 years agodoc/go_spec: remove extra space, align tags, and change a tab to a space.
Oling Cat [Thu, 24 Jan 2013 09:46:33 +0000 (20:46 +1100)]
doc/go_spec: remove extra space, align tags, and change a tab to a space.

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

12 years agoall: use t.Skip{,f}
Dave Cheney [Thu, 24 Jan 2013 06:32:10 +0000 (17:32 +1100)]
all: use t.Skip{,f}

Replace various t.Log{,f} ; return checks with t.Skip{,f}.

R=golang-dev, n13m3y3r, bradfitz, adg, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/7193044

12 years agogo/build: document blank line required after build constraints
Rick Arnold [Thu, 24 Jan 2013 02:32:46 +0000 (13:32 +1100)]
go/build: document blank line required after build constraints

Fixes #3539.

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

12 years agogo/types: typechecking conversions, part 1 (non-constants)
Robert Griesemer [Wed, 23 Jan 2013 18:57:18 +0000 (10:57 -0800)]
go/types: typechecking conversions, part 1 (non-constants)

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

12 years agocrypto/x509: skip SystemRootsError test on Windows
Mikkel Krautz [Wed, 23 Jan 2013 17:20:17 +0000 (01:20 +0800)]
crypto/x509: skip SystemRootsError test on Windows

On Windows, crypto/x509 passes through to Windows's CryptoAPI
to verify certificate chains. This method can't produce a
SystemRootsError, so make sure we always skip the test on
Windows.

This is needed because testVerify is called in both
TestGoVerify and TestSystemVerify on Windows - one is for
testing the Go verifier, the other one is for testing the
CryptoAPI verifier. The orignal CL tried to sidestep
this issue by setting systemSkip to true, but that only
affected TestSystemVerify.

R=golang-dev, agl, snaury, minux.ma
CC=golang-dev
https://golang.org/cl/7185043

12 years agoexp/locale/collate: added functionality for sorting.
Marcel van Lohuizen [Wed, 23 Jan 2013 13:16:22 +0000 (14:16 +0100)]
exp/locale/collate: added functionality for sorting.
Eliminates the need for the user to fiddle with keys.

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

12 years agoexp/locale/collate: preparation for adding Search API. Also changed the collate API
Marcel van Lohuizen [Wed, 23 Jan 2013 13:15:51 +0000 (14:15 +0100)]
exp/locale/collate: preparation for adding Search API. Also changed the collate API
further to how (I believe) it will end up being.
It is nicer to separate search from sorting functionality. Collation needs tables that
are not needed by search and vice-versa.  The common functionality is separated out
in the Weigher interface.  As this interface is very low-level, it will be moved to
a sub package (colltab) in a next CL.
The types that will move to this package are Weigher, Elem, and Level.  The addition
of Elem allows for removing some of the duplicate code between collate and collate/build.
This CL also introduces some stubs for a higher-level API for options. The default
proposed options are quite complex and require the user to have a decent understanding
of Unicode collation.  The new options hide a lot of the complexity.

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

12 years agosyscall: fix fork-exec/wait inconsistencies for Plan 9
Akshat Kumar [Wed, 23 Jan 2013 03:42:44 +0000 (22:42 -0500)]
syscall: fix fork-exec/wait inconsistencies for Plan 9

Fixes the fork-exec/wait race condition for ForkExec
as well, by making it use startProcess. This makes the
comment for StartProcess consistent as well.

Further, the passing of Waitmsg data in startProcess
and WaitProcess is protected against possible forks
from outside of ForkExec and StartProcess, which might
cause interference with the Await call.

R=rsc, rminnich, npe, ality
CC=golang-dev
https://golang.org/cl/7128059

12 years agoAUTHORS: remove Vega Garcia Luis Alfonso (covered by Google CLA)
Russ Cox [Wed, 23 Jan 2013 03:42:08 +0000 (22:42 -0500)]
AUTHORS: remove Vega Garcia Luis Alfonso (covered by Google CLA)

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

12 years agodoc/articles/race_detector: fix some format.
Oling Cat [Wed, 23 Jan 2013 03:22:03 +0000 (14:22 +1100)]
doc/articles/race_detector: fix some format.

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

12 years agoxml: Support fields not of type []byte when marshaling ",chardata"
Vega Garcia Luis Alfonso [Wed, 23 Jan 2013 03:13:40 +0000 (22:13 -0500)]
xml: Support fields not of type []byte when marshaling ",chardata"

Fixes #4506.

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

12 years agoA+C: Vega Garcia Luis Alfonso (individual CLA)
Russ Cox [Wed, 23 Jan 2013 03:13:24 +0000 (22:13 -0500)]
A+C: Vega Garcia Luis Alfonso (individual CLA)

Generated by addca.

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

12 years agogo/build: fix TestBogusDirectory format and maybe Windows failure
Brad Fitzpatrick [Wed, 23 Jan 2013 01:50:12 +0000 (17:50 -0800)]
go/build: fix TestBogusDirectory format and maybe Windows failure

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

12 years agotime: make TestReset more reliable
Brad Fitzpatrick [Wed, 23 Jan 2013 01:25:58 +0000 (17:25 -0800)]
time: make TestReset more reliable

Fixes #4690

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

12 years agonet/url: use bytes.Buffer in (*URL).String
Andrew Gerrand [Wed, 23 Jan 2013 01:17:11 +0000 (12:17 +1100)]
net/url: use bytes.Buffer in (*URL).String

BenchmarkString before:

        11990 ns/op            1621 B/op         73 allocs/op

Using bytes.Buffer:

        8774 ns/op            1994 B/op         40 allocs/op

I also tried making a version of escape() that writes directly to the
bytes.Buffer, but it only saved 1 alloc/op and increased CPU time by
about 10%. Didn't seem worth the extra code path.

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

12 years agonet/url: generate correct Path when hostname empty
Andrew Gerrand [Wed, 23 Jan 2013 00:37:06 +0000 (11:37 +1100)]
net/url: generate correct Path when hostname empty

Parse("file:///foo") previously returned a URL with Scheme "file"
and Path "///foo". Now it returns a URL with Path "/foo",
such that
        &URL{Scheme: "file", Path: "/foo"}.String() == "file:///foo"

This means that parsing and stringifying the URL "file:/foo"
returns "file:///foo", technically a regression but one that only
affects a corner case.

Fixes #4189.

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

12 years agogo/build: ImportDir reject directories that don't exist
Andrew Gerrand [Wed, 23 Jan 2013 00:28:32 +0000 (11:28 +1100)]
go/build: ImportDir reject directories that don't exist

Fixes #3428.

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

12 years agotesting: add Skip/Skipf
Dave Cheney [Tue, 22 Jan 2013 23:22:33 +0000 (10:22 +1100)]
testing: add Skip/Skipf

This proposal adds two methods to *testing.T, Skip(string) and Skipf(format, args...). The intent is to replace the existing log and return idiom which currently has 97 cases in the standard library. A simple example of Skip would be:

func TestSomethingLong(t *testing.T) {
        if testing.Short() {
                t.Skip("skipping test in short mode.")
                // not reached
        }
        ... time consuming work
}

Additionally tests can be skipped anywhere a *testing.T is present. An example adapted from the go.crypto/ssh/test package would be:

// setup performs some before test action and returns a func()
// which should be defered by the caller for cleanup.
func setup(t *testing.T) func() {
        ...
        cmd := exec.Command("sshd", "-f", configfile, "-i")
        if err := cmd.Run(); err != nil {
                t.Skipf("could not execute mock ssh server: %v", err)
        }
        ...
        return func() {
                // stop subprocess and cleanup
        }
}

func TestDialMockServer(t *testing.T) {
        cleanup := setup(t)
        defer cleanup()
        ...
}

In verbose mode tests that are skipped are now reported as a SKIP, rather than PASS.

Link to discussion: https://groups.google.com/d/topic/golang-nuts/BqorNARzt4U/discussion

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

12 years agoencoding/json: ignore unexported fields in Unmarshal
Rick Arnold [Tue, 22 Jan 2013 22:49:07 +0000 (17:49 -0500)]
encoding/json: ignore unexported fields in Unmarshal

Go 1.0 behavior was to create an UnmarshalFieldError when a json value name matched an unexported field name. This error will no longer be created and the field will be skipped instead.

Fixes #4660.

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

12 years agocmd/api: fix type scrubbing
Brad Fitzpatrick [Tue, 22 Jan 2013 22:29:38 +0000 (14:29 -0800)]
cmd/api: fix type scrubbing

It wasn't removing names from func parameters for func types,
and it was handling "a, b string" as "string", not "string, string".

Fixes #4688

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

12 years agolib9: declare __fixargv0 before use in flag.c
Akshat Kumar [Tue, 22 Jan 2013 22:23:36 +0000 (17:23 -0500)]
lib9: declare __fixargv0 before use in flag.c

The Plan 9 compilers complain about not
having type information for the function,
which sets off type signature problems
during the linking stage.

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

12 years agofmt: Remove dead code and make comments and variables consistent.
Robin Eklind [Tue, 22 Jan 2013 22:12:45 +0000 (17:12 -0500)]
fmt: Remove dead code and make comments and variables consistent.

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

12 years agonet: don't return nil interface address on netbsd
Mikio Hara [Tue, 22 Jan 2013 22:11:22 +0000 (07:11 +0900)]
net: don't return nil interface address on netbsd

On NetBSD routing sockaddrs for interface address contain sockaddr_dl.

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

12 years agoencoding/xml: simplify copyValue
Russ Cox [Tue, 22 Jan 2013 22:05:45 +0000 (17:05 -0500)]
encoding/xml: simplify copyValue

Delete various complications left over from an earlier reflect API.

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

12 years agocmd/go: suppress extraneous newlines in list
Anthony Martin [Tue, 22 Jan 2013 22:05:13 +0000 (17:05 -0500)]
cmd/go: suppress extraneous newlines in list

Before:
$ go list -f '{{range .Deps}}{{println $.Name .}}{{end}}' math time
math runtime
math unsafe

time errors
time runtime
time sync
time sync/atomic
time syscall
time unsafe

$

After:
$ go list -f '{{range .Deps}}{{println $.Name .}}{{end}}' math time
math runtime
math unsafe
time errors
time runtime
time sync
time sync/atomic
time syscall
time unsafe
$

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

12 years agomime, strconv: Make testdata more consistent.
Robin Eklind [Tue, 22 Jan 2013 21:44:35 +0000 (13:44 -0800)]
mime, strconv: Make testdata more consistent.

All packages place testdata in a specific directory with the name
"testdata". The mime and strconv packages have been updated to use
the same convention.

mime: Move "mime/test.types" to "mime/testdata/test.types". Update test
code accordingly.

strconv: Move "strconv/testfp.txt" to "strconv/testdata/testfp.txt".
Update test code accordingly.

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

12 years agotime: standard time doc fix and format example
Caleb Spare [Tue, 22 Jan 2013 19:44:49 +0000 (14:44 -0500)]
time: standard time doc fix and format example

This fixes the incorrect unix timestamp of the standard time and adds
an example for (Time) Format to clarify how timezones work in format strings.

Fixes #4364.

R=golang-dev, remyoudompheng, kevlar, rsc
CC=golang-dev
https://golang.org/cl/7069046

12 years agocmd/go: add hg ssh support
Dustin Shields-Cloues [Tue, 22 Jan 2013 19:43:37 +0000 (14:43 -0500)]
cmd/go: add hg ssh support

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

12 years agoA+C: Dustin Shields-Cloues (individual CLA)
Russ Cox [Tue, 22 Jan 2013 19:43:25 +0000 (14:43 -0500)]
A+C: Dustin Shields-Cloues (individual CLA)

Generated by addca.

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

12 years agosyscall: fix arithmetic errors in assembly for seek function for 64-bit Plan 9
Akshat Kumar [Tue, 22 Jan 2013 19:03:30 +0000 (14:03 -0500)]
syscall: fix arithmetic errors in assembly for seek function for 64-bit Plan 9

Offsets for return values from seek were miscalculated
and a translation from 32-bit code for error handling
was incorrect.

R=rsc, rminnich, npe
CC=golang-dev
https://golang.org/cl/7181045

12 years agodoc/effective_go.html: add a section about the blank identifier
Russ Cox [Tue, 22 Jan 2013 19:00:10 +0000 (14:00 -0500)]
doc/effective_go.html: add a section about the blank identifier

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

12 years agocrypto/tls: allow the server to enforce its ciphersuite preferences.
Adam Langley [Tue, 22 Jan 2013 15:10:38 +0000 (10:10 -0500)]
crypto/tls: allow the server to enforce its ciphersuite preferences.

Previously, Go TLS servers always took the client's preferences into
account when selecting a ciphersuite. This change adds the option of
using the server's preferences, which can be expressed by setting
tls.Config.CipherSuites.

This mirrors Apache's SSLHonorCipherOrder directive.

R=golang-dev, nightlyone, bradfitz, ality
CC=golang-dev
https://golang.org/cl/7163043

12 years agoruntime: account stop-the-world time in the "other" GOGCTRACE section
Dmitriy Vyukov [Tue, 22 Jan 2013 09:44:49 +0000 (13:44 +0400)]
runtime: account stop-the-world time in the "other" GOGCTRACE section
Currently it's summed to mark phase.
The change makes it easier to diagnose long stop-the-world phases.

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

12 years agodoc/go_spec: cap doesn't apply to maps
Shenghou Ma [Mon, 21 Jan 2013 19:18:20 +0000 (03:18 +0800)]
doc/go_spec: cap doesn't apply to maps
Fixes #4682.

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

12 years agocmd/cgo: doc updates
Shenghou Ma [Mon, 21 Jan 2013 18:52:34 +0000 (02:52 +0800)]
cmd/cgo: doc updates
1. note that to use C.free <stdlib.h> must be included
2. can also extract errno from a void C function

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

12 years agocmd/5l: move offset2 into Adr.u0 union to save 4/8 bytes for Adr/Prog resp.
Shenghou Ma [Mon, 21 Jan 2013 18:50:27 +0000 (02:50 +0800)]
cmd/5l: move offset2 into Adr.u0 union to save 4/8 bytes for Adr/Prog resp.
sizeof(Adr) from 24 bytes down to 20 bytes.
sizeof(Prog) from 84 bytes down to 76 bytes.

5l linking cmd/godoc statistics:
Before:
Maximum resident set size (kbytes): 106668
After:
Maximum resident set size (kbytes):  99412

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

12 years agotext/template/parse: don't show itemType in error messages
Shenghou Ma [Mon, 21 Jan 2013 18:48:40 +0000 (02:48 +0800)]
text/template/parse: don't show itemType in error messages
so that the user don't need to decipher something like this:
template: main:1: expected %!s(parse.itemType=14) in end; got "|"
now they get this:
template: main:1: unexpected "|" in end

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

12 years agocrypto/x509: return a better error when we fail to load system roots.
Adam Langley [Mon, 21 Jan 2013 16:25:28 +0000 (11:25 -0500)]
crypto/x509: return a better error when we fail to load system roots.

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

12 years agocrypto/cipher: don't persist errors in StreamWriter.
Adam Langley [Mon, 21 Jan 2013 16:22:08 +0000 (11:22 -0500)]
crypto/cipher: don't persist errors in StreamWriter.

I messed this up from the beginning. The receiver isn't a pointer so
setting Err is useless. In order to maintain the API, just remove the
superfluous code.

Fixes #4657.

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

12 years agoC: add Bill Neubauer's Gmail account
Andrew Gerrand [Sun, 20 Jan 2013 23:53:39 +0000 (10:53 +1100)]
C: add Bill Neubauer's Gmail account

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

12 years agocmd/5l: reduce the size of Prog and Sym
Dave Cheney [Sun, 20 Jan 2013 09:14:24 +0000 (20:14 +1100)]
cmd/5l: reduce the size of Prog and Sym

Prog
* Remove the unused Prog* dlink
* note that align is also unused, but removing it does not help due to alignment issues.

Saves 4 bytes, sizeof(Prog): 84 => 80.

Sym
* Align {u,}char fields on word boundaries

Saves 4 bytes, sizeof(Sym): 136 => 132.

Tested on linux/arm and freebsd/arm.

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

12 years agocmd/api: sort features
Anthony Martin [Sun, 20 Jan 2013 06:20:46 +0000 (22:20 -0800)]
cmd/api: sort features

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

12 years agoundo CL 5687057 / 58bc8aae4abb
Mikio Hara [Sat, 19 Jan 2013 14:13:01 +0000 (23:13 +0900)]
undo CL 5687057 / 58bc8aae4abb

Fortunately we have never seen the panic on sockaddrToTCP
in the past year.

««« original CL description
net: panic if sockaddrToTCP returns nil incorrectly
Part of diagnosing the selfConnect bug
TBR=dsymonds

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

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

12 years agocmd/8l, cmd/6l: avoid zeroing zeroed fields
Dave Cheney [Sat, 19 Jan 2013 09:23:25 +0000 (20:23 +1100)]
cmd/8l, cmd/6l: avoid zeroing zeroed fields

mal() returns zeroed memory, so zeroing these fields is redundant.

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

12 years agocmd/8g, cmd/dist, cmd/gc: fix warnings on Plan 9
Anthony Martin [Sat, 19 Jan 2013 03:08:00 +0000 (19:08 -0800)]
cmd/8g, cmd/dist, cmd/gc: fix warnings on Plan 9

cmd/8g/gsubr.c: unreachable code
cmd/8g/reg.c: overspecifed class
cmd/dist/plan9.c: unused parameter
cmd/gc/fmt.c: stkdelta is now a vlong
cmd/gc/racewalk.c: used but not set

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

12 years agocmd/6c, cmd/8c: fix print format for Prog
Anthony Martin [Sat, 19 Jan 2013 03:00:38 +0000 (19:00 -0800)]
cmd/6c, cmd/8c: fix print format for Prog

The FmtLong flag should only be used with the %D verb
when printing an ATEXT Prog. It was erroneously used
for every Prog except ADATA. This caused a preponderance
of exclamation points, "!!", in the assembly listings.

I also cleaned up the code so that the list.c files look
very similar. Now the real differences are easily spotted
with a simple diff.

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

12 years agodoc: fix effective_go: s/byte array/byte slice/.
Nigel Tao [Sat, 19 Jan 2013 02:36:59 +0000 (13:36 +1100)]
doc: fix effective_go: s/byte array/byte slice/.

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

12 years agoapi: update next.txt
Russ Cox [Fri, 18 Jan 2013 22:57:07 +0000 (17:57 -0500)]
api: update next.txt

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