]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agoreflect: add Type.ConvertibleTo, Value.Convert (API CHANGE)
Russ Cox [Sat, 22 Sep 2012 12:52:27 +0000 (08:52 -0400)]
reflect: add Type.ConvertibleTo, Value.Convert (API CHANGE)

Fixes #4047.

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

12 years agocmd/cgo: use debug data for enums on windows
Joel Sing [Sat, 22 Sep 2012 07:57:54 +0000 (17:57 +1000)]
cmd/cgo: use debug data for enums on windows

Use the debug data for enums on windows.

Fixes #4120.

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

12 years agodebug/pe: add symbol support
Joel Sing [Sat, 22 Sep 2012 07:56:49 +0000 (17:56 +1000)]
debug/pe: add symbol support

Add support for processing the COFF symbol table.

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

12 years agocmd/gc: fix a spurious -u compile error
Russ Cox [Sat, 22 Sep 2012 01:12:41 +0000 (21:12 -0400)]
cmd/gc: fix a spurious -u compile error

Fixes #4082.

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

12 years agocgo: set alignment to 1 for unions and classes; avoids crash from divide-by-zero
Rob Pike [Fri, 21 Sep 2012 21:25:41 +0000 (07:25 +1000)]
cgo: set alignment to 1 for unions and classes; avoids crash from divide-by-zero
Fixes #4114.

R=golang-dev, iant, rsc, iant, devon.odell
CC=golang-dev
https://golang.org/cl/6553050

12 years agodoc: document go1.0.3
Andrew Gerrand [Fri, 21 Sep 2012 19:50:38 +0000 (14:50 -0500)]
doc: document go1.0.3

R=rsc, r
CC=gobot, golang-dev
https://golang.org/cl/6532049

12 years agodoc/talks: remove talks, refer to talks.golang.org instead
Andrew Gerrand [Fri, 21 Sep 2012 19:38:22 +0000 (14:38 -0500)]
doc/talks: remove talks, refer to talks.golang.org instead

These talks have been moved to the go.talks sub-repository:
        https://code.google.com/p/go.talks

R=rsc, r
CC=gobot, golang-dev
https://golang.org/cl/6529052

12 years agocmd/6g: cosmetic improvements to regopt debugging.
Rémy Oudompheng [Fri, 21 Sep 2012 18:20:26 +0000 (20:20 +0200)]
cmd/6g: cosmetic improvements to regopt debugging.

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

12 years agocmd/6g: use all 16 float registers, optimize float moves
Russ Cox [Fri, 21 Sep 2012 17:39:09 +0000 (13:39 -0400)]
cmd/6g: use all 16 float registers, optimize float moves

Fixes #2446.

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

12 years agoruntime: fix typos in comments
Jan Ziak [Fri, 21 Sep 2012 16:25:55 +0000 (12:25 -0400)]
runtime: fix typos in comments

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

12 years agoruntime: fix mmap comments
Shenghou Ma [Fri, 21 Sep 2012 05:50:02 +0000 (13:50 +0800)]
runtime: fix mmap comments
We only pass lower 32 bits of file offset to asm routine.

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

12 years agoall: match asm variable names to Go func declarations
Russ Cox [Fri, 21 Sep 2012 04:35:56 +0000 (00:35 -0400)]
all: match asm variable names to Go func declarations

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

12 years agounicode: performance improvements (API change)
Russ Cox [Fri, 21 Sep 2012 04:35:25 +0000 (00:35 -0400)]
unicode: performance improvements (API change)

*** There is an API change here: the introduction of the
LatinOffset int in the RangeTable struct. ***

* Avoid checking Latin range multiple times for non-Latin runes.
* Use linear search when it is faster than binary search.

go test -calibrate runs the calibration for where the linear/binary
crossover should be.

benchmark                       old MB/s     new MB/s  speedup
BenchmarkFields            36.27        41.43    1.14x
BenchmarkFieldsFunc        36.23        41.38    1.14x

The speedup here is evenly split between the linear scans
and the LatinOffset change. Both are about 1.07x.

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

12 years agocmd/{ld,5l,6l,8l}: add support for OpenBSD ELF signatures
Joel Sing [Fri, 21 Sep 2012 02:51:39 +0000 (12:51 +1000)]
cmd/{ld,5l,6l,8l}: add support for OpenBSD ELF signatures

OpenBSD now requires ELF binaries to have a PT_NOTE that identifies
it as an OpenBSD binary. Refactor the existing NetBSD ELF signature
code and implement support for OpenBSD ELF signatures.

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

12 years agonet: fix comment
Mikio Hara [Thu, 20 Sep 2012 22:13:36 +0000 (07:13 +0900)]
net: fix comment

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

12 years agosync: add Once test with panic
Dmitriy Vyukov [Thu, 20 Sep 2012 19:29:29 +0000 (23:29 +0400)]
sync: add Once test with panic
Tests behavior of Once when initialization function panics.

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

12 years agocmd/ld: remove unused assignment
Lucio De Re [Thu, 20 Sep 2012 18:58:33 +0000 (14:58 -0400)]
cmd/ld: remove unused assignment

The calculation of datsize is redundant.

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

12 years agoruntime: reset parfor stats
Dmitriy Vyukov [Thu, 20 Sep 2012 18:46:24 +0000 (22:46 +0400)]
runtime: reset parfor stats
Otherwise they sum up between GCs.

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

12 years agocrypto/x509: Use ExtKeyUsage and UnknownExtKeyUsage fields from template in CreateCer...
Andrew Harding [Thu, 20 Sep 2012 16:36:37 +0000 (12:36 -0400)]
crypto/x509: Use ExtKeyUsage and UnknownExtKeyUsage fields from template in CreateCertificate

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/6535057

12 years agocrypto/x509: ignore non-critical email constraints
Adam Langley [Thu, 20 Sep 2012 16:30:56 +0000 (12:30 -0400)]
crypto/x509: ignore non-critical email constraints

Previously we tried to parse email constraints as the maximum base
distance (which is unused and must be omitted according to RFC 5280)
because they share the same tag number. Rather than complicate the
code further, this CL just ignores the unused values.

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

12 years agoA+C: Add Andrew Harding (Individual CLA)
Adam Langley [Thu, 20 Sep 2012 16:24:36 +0000 (12:24 -0400)]
A+C: Add Andrew Harding  (Individual CLA)

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

12 years agocgo: process DWARF info even when debug data is used for value
Joel Sing [Thu, 20 Sep 2012 03:20:33 +0000 (13:20 +1000)]
cgo: process DWARF info even when debug data is used for value

Always process the DWARF info, even when the const value is determined
using the debug data block. This ensures that the injected enum is
removed and future loads of the same constant do not trigger
inconsistent definitions.

Add tests for issues 2470 and 4054.
Fixes #4054.

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

12 years agomisc/cgo/test: do not run wasteCPU during TestParallelSleep unless on arm
Alex Brainman [Thu, 20 Sep 2012 02:06:08 +0000 (12:06 +1000)]
misc/cgo/test: do not run wasteCPU during TestParallelSleep unless on arm

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

12 years agovet: fix rangeloop.
David Symonds [Wed, 19 Sep 2012 22:12:47 +0000 (08:12 +1000)]
vet: fix rangeloop.

In a range loop, the presence of a value implies the presence of a key.
However, the presence of a value as an *ast.Ident does not imply that
the key is also an *ast.Ident, thus leading to a panic any time the
two argument form is used where the key is not an identifier.

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

12 years agomisc/vim: fix Drop for imports after the first group.
David Symonds [Wed, 19 Sep 2012 22:11:07 +0000 (08:11 +1000)]
misc/vim: fix Drop for imports after the first group.

Previously, an import block such as
import (
         "net"

                "stack"
        )
would not permit ":Drop stack" to work because we were aborting
the scan early, which is only correct when Import is in operation.

R=golang-dev, franciscossouza
CC=golang-dev
https://golang.org/cl/6532053

12 years agogofmt: added testcase for files containing \r\n line endings
Robert Griesemer [Wed, 19 Sep 2012 21:14:21 +0000 (14:14 -0700)]
gofmt: added testcase for files containing \r\n line endings
(see also issue 3961).

hexdump -c testdata/crlf.input
0000000   /   *  \r  \n  \t   S   o   u   r   c   e       c   o   n   t
0000010   a   i   n   i   n   g       C   R   /   L   F       l   i   n
0000020   e       e   n   d   i   n   g   s   .  \r  \n  \t   T   h   e
0000030       g   o   f   m   t   '   e   d       o   u   t   p   u   t
0000040       m   u   s   t       o   n   l   y       h   a   v   e
0000050   L   F  \r  \n  \t   l   i   n   e       e   n   d   i   n   g
0000060   s   .  \r  \n   *   /  \r  \n   p   a   c   k   a   g   e
0000070   m   a   i   n  \r  \n  \r  \n   f   u   n   c       m   a   i
0000080   n   (   )       {  \r  \n  \t   /   /       l   i   n   e
0000090   c   o   m   m   e   n   t  \r  \n  \t   p   r   i   n   t   l
00000a0   n   (   "   h   e   l   l   o   ,       w   o   r   l   d   !
00000b0   "   )       /   /       a   n   o   t   h   e   r       l   i
00000c0   n   e       c   o   m   m   e   n   t  \r  \n  \t   p   r   i
00000d0   n   t   l   n   (   )  \r  \n   }  \r  \n
00000db

hexdump -c testdata/crlf.golden
0000000   /   *  \n  \t   S   o   u   r   c   e       c   o   n   t   a
0000010   i   n   i   n   g       C   R   /   L   F       l   i   n   e
0000020       e   n   d   i   n   g   s   .  \n  \t   T   h   e       g
0000030   o   f   m   t   '   e   d       o   u   t   p   u   t       m
0000040   u   s   t       o   n   l   y       h   a   v   e       L   F
0000050  \n  \t   l   i   n   e       e   n   d   i   n   g   s   .  \n
0000060   *   /  \n   p   a   c   k   a   g   e       m   a   i   n  \n
0000070  \n   f   u   n   c       m   a   i   n   (   )       {  \n  \t
0000080   /   /       l   i   n   e       c   o   m   m   e   n   t  \n
0000090  \t   p   r   i   n   t   l   n   (   "   h   e   l   l   o   ,
00000a0       w   o   r   l   d   !   "   )       /   /       a   n   o
00000b0   t   h   e   r       l   i   n   e       c   o   m   m   e   n
00000c0   t  \n  \t   p   r   i   n   t   l   n   (   )  \n   }  \n
00000cf

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

12 years agoencoding/gob: fix comment
Robert Griesemer [Wed, 19 Sep 2012 17:11:24 +0000 (10:11 -0700)]
encoding/gob: fix comment

Fixes #4100.

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

12 years agosrc/all.bat: fix banner
Shenghou Ma [Wed, 19 Sep 2012 16:58:34 +0000 (00:58 +0800)]
src/all.bat: fix banner
we need to restore %PATH% before calling "dist banner", so that
it could suggest the user to add %GOROOT%/bin to %PATH% if necessary.

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

12 years agomisc/cgo/stdio: make it work on Windows and also test it
Shenghou Ma [Wed, 19 Sep 2012 16:27:23 +0000 (00:27 +0800)]
misc/cgo/stdio: make it work on Windows and also test it
use a function to get stdout and stderr, instead of depending
on a specific libc implementation.
also make test/run.go replace \r\n by \n before comparing
output.

        Fixes #2121.
        Part of issue 1741.

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

12 years agocmd/ld: consistent binary for cgo programs
Shenghou Ma [Wed, 19 Sep 2012 16:18:41 +0000 (00:18 +0800)]
cmd/ld: consistent binary for cgo programs
We use pkg path instead of file name (which contains $WORK) in section symbols names.

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

12 years agoos: use small writes during console io
Alex Brainman [Wed, 19 Sep 2012 06:55:21 +0000 (16:55 +1000)]
os: use small writes during console io

Fixes #3767

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

12 years agoapi: fix build; regenerate api.txt with fixed signatures
Brad Fitzpatrick [Wed, 19 Sep 2012 05:04:07 +0000 (22:04 -0700)]
api: fix build; regenerate api.txt with fixed signatures

Update to tip (to get 6475062 and 6525047)
Rebuild cmd/api.
Switch to a go1 release branch.
Run go tool api > api/go1.txt.new in release branch.
Back to tip.

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

12 years agomisc/cgo/test and test/bench/go1: enable these tests on windows
Alex Brainman [Wed, 19 Sep 2012 02:07:25 +0000 (12:07 +1000)]
misc/cgo/test and test/bench/go1: enable these tests on windows

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

12 years agocmd/api: fix signatures like func(x, y, z int)
Mikio Hara [Tue, 18 Sep 2012 22:04:12 +0000 (07:04 +0900)]
cmd/api: fix signatures like func(x, y, z int)

Fixes writing of function parameter, result lists which
consist of multiple named or unnamed items with same type.

Fixes #4011.

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

12 years agovet: add range variable misuse detection
Andrew Gerrand [Tue, 18 Sep 2012 21:19:31 +0000 (14:19 -0700)]
vet: add range variable misuse detection

R=fullung, r, remyoudompheng, minux.ma, gri, rsc
CC=golang-dev
https://golang.org/cl/6494075

12 years agogo/doc: synthesize "package main" for examples
Andrew Gerrand [Tue, 18 Sep 2012 21:13:34 +0000 (14:13 -0700)]
go/doc: synthesize "package main" for examples

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

12 years agorace: linker changes
Dmitriy Vyukov [Tue, 18 Sep 2012 21:05:25 +0000 (01:05 +0400)]
race: linker changes
This is the second part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044
This change makes the linker emit dependency on runtime/race package when supplied with -b flag.

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

12 years agocmd/api: allow extension of interfaces with unexported methods
Russ Cox [Tue, 18 Sep 2012 19:57:03 +0000 (15:57 -0400)]
cmd/api: allow extension of interfaces with unexported methods

Fixes #4061.

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

12 years agorace: build system changes
Dmitriy Vyukov [Tue, 18 Sep 2012 19:47:15 +0000 (23:47 +0400)]
race: build system changes
This is the first part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044
Adds -race flag to go command.
API change:
+pkg go/build, type Context struct, InstallTag string

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

12 years agorace: cmd/cgo changes
Dmitriy Vyukov [Tue, 18 Sep 2012 19:42:18 +0000 (23:42 +0400)]
race: cmd/cgo changes
This is a part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044
This change breaks circular dependency between runtime/race and syscall packages.

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

12 years agobytes, strings: add Fields benchmarks
Russ Cox [Tue, 18 Sep 2012 19:02:08 +0000 (15:02 -0400)]
bytes, strings: add Fields benchmarks

The performance changes will be a few different CLs.
Start with benchmarks as a baseline.

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

12 years agoruntime: hide the semaphore table from garbage collector
Jan Ziak [Tue, 18 Sep 2012 18:30:01 +0000 (14:30 -0400)]
runtime: hide the semaphore table from garbage collector

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

12 years agospec: clarify expression statements
Robert Griesemer [Tue, 18 Sep 2012 18:25:53 +0000 (11:25 -0700)]
spec: clarify expression statements

Function and method calls are valid expression statements,
but calling certain built-in functions is not permitted.
Enumerate the built-ins.

Also: unsafe.Offsetof permits parenthesized selectors as
arguments.

This is simply documenting existing compiler behavior
(both gc and gccgo agree).

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

12 years agoreflect: use []unsafe.Pointer instead of []*int
Jan Ziak [Tue, 18 Sep 2012 18:23:11 +0000 (14:23 -0400)]
reflect: use []unsafe.Pointer instead of []*int

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

12 years agoencoding/json: do not read beyond array literal
Russ Cox [Tue, 18 Sep 2012 18:22:55 +0000 (14:22 -0400)]
encoding/json: do not read beyond array literal

Fixes #3942.

R=golang-dev, mike.rosset, r
CC=golang-dev
https://golang.org/cl/6524043

12 years agoreflect: add Select
Russ Cox [Tue, 18 Sep 2012 18:22:41 +0000 (14:22 -0400)]
reflect: add Select

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

12 years agobuiltin: Changed documentation for rune type.
Anthony Eufemio [Tue, 18 Sep 2012 18:01:10 +0000 (11:01 -0700)]
builtin: Changed documentation for rune type.
Fixes #4093.

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

12 years agoA+C: Add Anthony Eufemio (Individual CLA)
Brad Fitzpatrick [Tue, 18 Sep 2012 18:00:55 +0000 (11:00 -0700)]
A+C: Add Anthony Eufemio (Individual CLA)

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

12 years agoruntime: refactor goroutine blocking
Dmitriy Vyukov [Tue, 18 Sep 2012 17:15:46 +0000 (21:15 +0400)]
runtime: refactor goroutine blocking
The change is a preparation for the new scheduler.
It introduces runtime.park() function,
that will atomically unlock the mutex and park the goroutine.
It will allow to remove the racy readyonstop flag
that is difficult to implement w/o the global scheduler mutex.

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

12 years agoundo CL 6395055 / 2518eee18c4f
Mikio Hara [Tue, 18 Sep 2012 16:33:03 +0000 (01:33 +0900)]
undo CL 6395055 / 2518eee18c4f

Broke TCP selfConnect

««« original CL description
net: avoid nil pointer dereference when RemoteAddr.String method chain is called

Fixes #3721.

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

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

12 years agodoc/effective_go: Closed some tags; removed extra spaces.
Oling Cat [Tue, 18 Sep 2012 15:50:24 +0000 (08:50 -0700)]
doc/effective_go: Closed some tags; removed extra spaces.

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

12 years agocmd/gc: fix double evaluation in interface comparison
Daniel Morsing [Tue, 18 Sep 2012 15:40:53 +0000 (17:40 +0200)]
cmd/gc: fix double evaluation in interface comparison

During interface compare, the operands will be evaluated twice. The operands might include function calls for conversion, so make them cheap before comparing them.

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

12 years agoimage/jpeg: ignore an incorrect but harmless trailing restart marker.
Nigel Tao [Tue, 18 Sep 2012 11:57:33 +0000 (21:57 +1000)]
image/jpeg: ignore an incorrect but harmless trailing restart marker.

Fixes #4084.

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

12 years agosyscall: attempt to find error message in "local" language before resorting to error...
Alex Brainman [Tue, 18 Sep 2012 03:02:37 +0000 (13:02 +1000)]
syscall: attempt to find error message in "local" language before resorting to error number on windows

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

12 years agodoc: document OS X tarballs
Andrew Gerrand [Tue, 18 Sep 2012 00:01:09 +0000 (17:01 -0700)]
doc: document OS X tarballs

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

12 years agomisc/dist: generate tarballs for Mac OS X
Andrew Gerrand [Mon, 17 Sep 2012 23:59:16 +0000 (16:59 -0700)]
misc/dist: generate tarballs for Mac OS X

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

12 years agoruntime: arm: abort if VFPv3 support missing
Dave Cheney [Mon, 17 Sep 2012 23:55:07 +0000 (09:55 +1000)]
runtime: arm: abort if VFPv3 support missing

Fixes #3456.

This proposal is a reformulation of CL 5987063. This CL resets
the default GOARM value to 6 and allows the use of the VFPv3
optimisation if GOARM=7. Binaries built with this CL in place
will abort if GOARM=7 was used and the target host does not
support VFPv3.

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

12 years agoA+C: update Eric Roshan-Eisner
Eric Roshan-Eisner [Mon, 17 Sep 2012 22:39:26 +0000 (08:39 +1000)]
A+C: update Eric Roshan-Eisner

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

12 years agobuild: fix various 'set and not used' for Plan 9
Lucio De Re [Mon, 17 Sep 2012 21:25:26 +0000 (17:25 -0400)]
build: fix various 'set and not used' for Plan 9

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

12 years agocmd/ld: fix compilation when GOARCH != GOHOSTARCH
Jan Ziak [Mon, 17 Sep 2012 21:18:21 +0000 (17:18 -0400)]
cmd/ld: fix compilation when GOARCH != GOHOSTARCH

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

12 years agomath: Faster Tanh
Charles L. Dorian [Mon, 17 Sep 2012 21:18:16 +0000 (17:18 -0400)]
math: Faster Tanh

From 159 to 47.6 ns/op; slightly more accurate.

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

12 years agocmd/go: reject relative values for GOPATH
Francisco Souza [Mon, 17 Sep 2012 20:44:55 +0000 (13:44 -0700)]
cmd/go: reject relative values for GOPATH

Fixes #4062.

R=rsc, dave, r
CC=golang-dev, nicksaika
https://golang.org/cl/6488129

12 years agocmd/gc: add missing conversion from bool to interface in switches.
Daniel Morsing [Mon, 17 Sep 2012 19:29:10 +0000 (21:29 +0200)]
cmd/gc: add missing conversion from bool to interface in switches.

In switches without an expression, the compiler would not convert the implicit true to an interface, causing codegen errors.

Fixes #3980.

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

12 years agospec: unsafe.Alignof/Sizeof also accept non-variable arguments
Robert Griesemer [Mon, 17 Sep 2012 19:23:41 +0000 (12:23 -0700)]
spec: unsafe.Alignof/Sizeof also accept non-variable arguments

Both gc and gccgo permit calls such as unsafe.Sizeof(42). The
spec only permits variable arguments. This is a (backward-compatible)
spec change reflecting the status quo. Seems preferrable over
restricting the compilers.

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

12 years agomisc/dashboard/builder: reinstate 'go get -d' error handling hack
Andrew Gerrand [Mon, 17 Sep 2012 18:21:02 +0000 (11:21 -0700)]
misc/dashboard/builder: reinstate 'go get -d' error handling hack

I thought this was redundant since the behavior of 'go get -d' had
changed. I was wrong. Should have tested more thoroughly.

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

12 years agounicode/utf8: add Examples
Sanjay Menakuru [Mon, 17 Sep 2012 18:06:42 +0000 (11:06 -0700)]
unicode/utf8: add Examples

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

12 years agomisc/dashboard/builder: increase default command timeout
Andrew Gerrand [Mon, 17 Sep 2012 18:05:43 +0000 (11:05 -0700)]
misc/dashboard/builder: increase default command timeout

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

12 years agomisc/dashboard/builder: add timeout to all external command invocations
Andrew Gerrand [Mon, 17 Sep 2012 17:41:47 +0000 (10:41 -0700)]
misc/dashboard/builder: add timeout to all external command invocations

Fixes #4083.

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

12 years agostrings: implement a faster generic Replacer
Eric Eisner [Mon, 17 Sep 2012 01:50:15 +0000 (11:50 +1000)]
strings: implement a faster generic Replacer

This also fixes the semantics of some corner cases with the empty
match. TODOs for genericReplacer in the tests are fixed.

benchmark                  old ns/op    new ns/op    delta
BenchmarkGenericNoMatch        71395         3132  -95.61%
BenchmarkGenericMatch1         75610        20280  -73.18%
BenchmarkGenericMatch2        837995        86725  -89.65%

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

12 years agorun.bash: fix a typo (fix build)
Shenghou Ma [Sun, 16 Sep 2012 17:26:57 +0000 (01:26 +0800)]
run.bash: fix a typo (fix build)

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

12 years agorun.bash: set appropriate ulimits
Shenghou Ma [Sun, 16 Sep 2012 17:11:28 +0000 (01:11 +0800)]
run.bash: set appropriate ulimits
    mainly for NetBSD/OpenBSD.

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

12 years agoruntime: fix SI_USER for FreeBSD
Shenghou Ma [Sun, 16 Sep 2012 17:08:41 +0000 (01:08 +0800)]
runtime: fix SI_USER for FreeBSD
Ref: http://svnweb.freebsd.org/base/head/sys/sys/signal.h?revision=HEAD&view=markup

R=golang-dev, devon.odell, r
CC=golang-dev
https://golang.org/cl/6490118

12 years agotext/template: towards better errors
Rob Pike [Fri, 14 Sep 2012 22:25:37 +0000 (15:25 -0700)]
text/template: towards better errors
Give the right name for errors, and add a test to check we're
getting the errors we expect.
Also fix an ordering bug (calling add after stopParse) that
caused a nil indirection rather than a helpful error.
Fixes #3280.

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

12 years agoos/exec: don't crash when out of fds
Brad Fitzpatrick [Fri, 14 Sep 2012 20:40:22 +0000 (13:40 -0700)]
os/exec: don't crash when out of fds

Command.Start could crash before if no fds were available
because a nil *os.File of /dev/null was added to the cleanup
list, which crashed before returning the proper error.

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

12 years agospec: clarify section on string types
Robert Griesemer [Fri, 14 Sep 2012 18:31:56 +0000 (11:31 -0700)]
spec: clarify section on string types

Strings happen to be represented similarly to
byte slices internally, but they don't quite
behave like them: While strings can be indexed,
sliced, and have their len() taken like byte
slices, string elements are not addressable,
make() and cap() is not supported, range loops
operate differently, and they are immutable (and
thus behave like values rather then references).

Fixes #4018.

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

12 years agogo/build: use custom file readers to avoid I/O
Russ Cox [Fri, 14 Sep 2012 16:22:45 +0000 (12:22 -0400)]
go/build: use custom file readers to avoid I/O

When reading Go files, read through import block.
When reading non-Go files, read only leading comments.

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

12 years agocmd/go: fix build
Russ Cox [Fri, 14 Sep 2012 16:21:57 +0000 (12:21 -0400)]
cmd/go: fix build

TBR=r

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

12 years agocmd/go: treat all commands in exp/ as tools
Russ Cox [Fri, 14 Sep 2012 16:06:21 +0000 (12:06 -0400)]
cmd/go: treat all commands in exp/ as tools

Nothing in exp should get installed directly in bin,
at least not by default.

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

12 years agoexp/locale/collate: changed API to allow access to different locales through New(),
Marcel van Lohuizen [Fri, 14 Sep 2012 10:10:02 +0000 (19:10 +0900)]
exp/locale/collate: changed API to allow access to different locales through New(),
instead of variables. Several reasons:
- Encourage users of the API to minimize the number of creations and reuse Collate objects.
- Don't rule out the possibility of using initialization code for collators. For some locales
  it will be possible to have very compact representations that can be quickly expanded
  into a proper table on demand.
Other changes:
- Change name of root* vars to main*, as the tables are shared between locales.
- Added Locales() method to get a list of supported locales.

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

12 years agomisc/dashboard/builder: use c:\ as default buildroot on windows
Alex Brainman [Fri, 14 Sep 2012 02:53:30 +0000 (12:53 +1000)]
misc/dashboard/builder: use c:\ as default buildroot on windows

We have some tests (misc/cgo/test) that are disabled only because
they will fail to run on go builder - see issue 3358 for details.
This change will allow us to enable these tests.

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

12 years agoA+C: add Xing Xing (individual CLA)
Andrew Gerrand [Fri, 14 Sep 2012 02:26:45 +0000 (12:26 +1000)]
A+C: add Xing Xing (individual CLA)

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

12 years agocmd/yacc: allow utf-8 token values
Rob Pike [Thu, 13 Sep 2012 20:59:00 +0000 (13:59 -0700)]
cmd/yacc: allow utf-8 token values
Also clean up the code and allow \U.
Fixes #3007.

R=golang-dev, rsc, 0xjnml
CC=golang-dev
https://golang.org/cl/6492105

12 years agoeffective_go: use html/template instead of text/template
Rob Pike [Thu, 13 Sep 2012 20:41:13 +0000 (13:41 -0700)]
effective_go: use html/template instead of text/template
Should have done this a long time ago.
Fixes #3811.

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

12 years agold: add .gcdata and .gcbss sections
Jan Ziak [Thu, 13 Sep 2012 19:59:34 +0000 (15:59 -0400)]
ld: add .gcdata and .gcbss sections

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

12 years agobuild: print go banner before restoring windows PATH
Brad Fitzpatrick [Thu, 13 Sep 2012 19:39:25 +0000 (12:39 -0700)]
build: print go banner before restoring windows PATH

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

12 years agocmd/gc: Specify which package import caused an redeclaration error.
Daniel Morsing [Thu, 13 Sep 2012 16:40:50 +0000 (18:40 +0200)]
cmd/gc: Specify which package import caused an redeclaration error.

Fixes #4012.

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

12 years agocrypto/tls: allow certificates and key to be in either order.
Adam Langley [Thu, 13 Sep 2012 15:00:16 +0000 (11:00 -0400)]
crypto/tls: allow certificates and key to be in either order.

X509KeyPair wasn't really supposed to allow the certificate and
key to be in the same file, but it did work if you put the key
first. Since some HTTPS servers support loading keys and certs
like this, this change makes it work in either order.

Fixes #3986.

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

12 years agohtml/template: fix URL doc
Russ Cox [Thu, 13 Sep 2012 14:53:00 +0000 (10:53 -0400)]
html/template: fix URL doc

This is the easy part of issue 3528.
(What to do about "noescape" is the hard part, left open.)

Update #3528.

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

12 years agocrypto/rsa: reject PublicKey.E if it won't fit in a 32-bit int
Russ Cox [Thu, 13 Sep 2012 14:47:01 +0000 (10:47 -0400)]
crypto/rsa: reject PublicKey.E if it won't fit in a 32-bit int

Right now we only have 32-bit ints so that's a no-op.
Took the opportunity to check for some other invalid values too.
Suggestions for additions or modifications welcome.

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

12 years agocmd/pack: rename __.SYMDEF to __.GOSYMDEF
Russ Cox [Thu, 13 Sep 2012 14:26:21 +0000 (10:26 -0400)]
cmd/pack: rename __.SYMDEF to __.GOSYMDEF

This fixes a problem with ELF tools thinking they know the
format of the symbol table, as we do not use any of the
standard formats for that table.

This change will probably annoy the Plan 9 users, but I
believe there are other incompatibilities already that mean
they have to use a Go-specific nm.

Fixes #3473.

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

12 years agogo/build: reject empty strings in Import
Francisco Souza [Thu, 13 Sep 2012 14:25:35 +0000 (10:25 -0400)]
go/build: reject empty strings in Import

Fixes #3889.

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

12 years agoimage/png: optimize encoding image.Gray and image.NRGBA images.
Nigel Tao [Thu, 13 Sep 2012 05:47:12 +0000 (15:47 +1000)]
image/png: optimize encoding image.Gray and image.NRGBA images.

benchmark                    old ns/op    new ns/op    delta
BenchmarkEncodeGray           23616080      5624558  -76.18%
BenchmarkEncodeNRGBOpaque     34181260     17144380  -49.84%
BenchmarkEncodeNRGBA          41235820     20345990  -50.66%
BenchmarkEncodePaletted        5594652      5620362   +0.46%
BenchmarkEncodeRGBOpaque      17242210     17168820   -0.43%
BenchmarkEncodeRGBA           66515720     67243560   +1.09%

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

12 years ago undo CL 6493071 / 56c7453d488f
Andrew Gerrand [Thu, 13 Sep 2012 01:14:20 +0000 (11:14 +1000)]
  undo CL 6493071 / 56c7453d488f

This change messes with anchor links. It obscures the item being linked to.
I don't see a way around it. Undoing for now.

      Fixes #4071.

      ««« original CL description
      doc css: topbar sticks to the top of large windows.
      Rationale: for large screens, the convenience of not having to scroll
      to the top of the page to do a search outweighs having less vertical
      space.
      Tested with Chrome, Firefox, Safari with various window and text sizes.

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

      Committer: Andrew Gerrand <adg@golang.org>
      »»»

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

12 years agonet/rpc/jsonrpc: fix test error message
Russ Cox [Wed, 12 Sep 2012 21:37:39 +0000 (17:37 -0400)]
net/rpc/jsonrpc: fix test error message

Fixes #4041.

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

12 years agogc: generate garbage collection info for types
Jan Ziak [Wed, 12 Sep 2012 16:08:27 +0000 (12:08 -0400)]
gc: generate garbage collection info for types

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

12 years agocmd/dist: emit \r in env -w output
Russ Cox [Wed, 12 Sep 2012 16:05:34 +0000 (12:05 -0400)]
cmd/dist: emit \r in env -w output

go tool dist env -w is supposed to print a Windows batch file.
Normally Windows will execute batch files without \r before \n,
but issue 3060 reports that if the file ends up containing paths
written in Chinese, Windows 7 cannot execute it without the \r.
So add the \r.

Fixes #3060.

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

12 years agospec: make bitwise operators stand out
Russ Cox [Wed, 12 Sep 2012 16:05:24 +0000 (12:05 -0400)]
spec: make bitwise operators stand out

The (and not) arguably sounds like it is trying to say something - and not what?.

Just an idea, won't be hurt if it gets rejected.

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

12 years agosyscall: add linux specific Getsockopt for Ucred struct
Andreas Jellinghaus [Wed, 12 Sep 2012 13:38:21 +0000 (06:38 -0700)]
syscall: add linux specific Getsockopt for Ucred struct

SO_PEERCRED on unix domain socket will fill a Ucred struct,
thus linux needs a custom Getsockopt variant.
Fixes #3836.

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

12 years agoC: Add Andreas Jellinghaus (Google CLA)
Ian Lance Taylor [Wed, 12 Sep 2012 13:34:42 +0000 (06:34 -0700)]
C: Add Andreas Jellinghaus (Google CLA)

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

12 years agocmd/6g, cmd/8g: clean up unnecessary switch code in componentgen.
Nigel Tao [Wed, 12 Sep 2012 11:47:05 +0000 (21:47 +1000)]
cmd/6g, cmd/8g: clean up unnecessary switch code in componentgen.
Code higher up in the function already catches these cases.

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