]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agogo/doc: move CommentText to ast.CommentGroup's Text method
Russ Cox [Thu, 12 Jan 2012 19:34:02 +0000 (11:34 -0800)]
go/doc: move CommentText to ast.CommentGroup's Text method

Now only godoc imports go/doc.

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

13 years agostrconv: fix round up corner case
Russ Cox [Thu, 12 Jan 2012 19:32:28 +0000 (11:32 -0800)]
strconv: fix round up corner case

Comment described the correct condition
but the code did not implement it.

Fixes #2625.

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

13 years agosql: fix potential corruption in QueryRow.Scan into a *[]byte
Brad Fitzpatrick [Thu, 12 Jan 2012 19:23:33 +0000 (11:23 -0800)]
sql: fix potential corruption in QueryRow.Scan into a *[]byte

Fixes #2622

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

13 years agodashboard: add deployment comment to app.yaml
Russ Cox [Thu, 12 Jan 2012 19:06:09 +0000 (11:06 -0800)]
dashboard: add deployment comment to app.yaml

Also update default app and version to be correct.

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

13 years agogo/build: allow colon in #cgo flags
Russ Cox [Thu, 12 Jan 2012 19:05:54 +0000 (11:05 -0800)]
go/build: allow colon in #cgo flags

This makes it possible to say -I c:/foo on Windows.

Fixes #2683 comment #3.

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

13 years agodashboard: use build.golang.org as the domain
Rob Pike [Thu, 12 Jan 2012 18:42:39 +0000 (10:42 -0800)]
dashboard: use build.golang.org as the domain
The domain returned by appengine.DefaultVersionHostname
isn't the one we want.
This change has been uploaded to build.golang.org

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

13 years agold: parse but do not implement -X flag
Russ Cox [Thu, 12 Jan 2012 18:23:24 +0000 (10:23 -0800)]
ld: parse but do not implement -X flag

This will let programs invoking ld prepare for it.
See issue 2676.

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

13 years agotesting: fix defer race
Russ Cox [Thu, 12 Jan 2012 18:18:12 +0000 (10:18 -0800)]
testing: fix defer race

In a test that does

        func TestFoo(t *testing.T) {
                defer cleanup()
                t.Fatal("oops")
        }

it can be important that cleanup run as the test fails.
The old code did this in Fatal:

        t.signal <- t
        runtime.Goexit()

The runtime.Goexit would run the deferred cleanup
but the send on t.signal would cause the main test loop
to move on and possibly even exit the program before
the runtime.Goexit got a chance to run.

This CL changes tRunner (the top stack frame of a test
goroutine) to send on t.signal as part of a function
deferred by the top stack frame.  This delays the send
on t.signal until after runtime.Goexit has run functions
deferred by the test itself.

For the above TestFoo, this CL guarantees that cleanup
will run before the test binary exits.

This is particularly important when cleanup is doing
externally visible work, like removing temporary files
or unmounting file systems.

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

13 years agocmd/go: fix linker arguments
Russ Cox [Thu, 12 Jan 2012 18:18:03 +0000 (10:18 -0800)]
cmd/go: fix linker arguments

Especially affects tests, but not test-specific.
The linker was only being told where to find the
direct dependencies of package main.  Sometimes that
was sufficient to find the rest; sometimes not.

Fixes #2657.
Fixes #2666.
Fixes #2680.

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

13 years agoeffective_go: provide reference to runtime.NumCPU()
Dmitriy Vyukov [Thu, 12 Jan 2012 18:06:50 +0000 (22:06 +0400)]
effective_go: provide reference to runtime.NumCPU()

R=golang-dev, robert.hencke, r
CC=golang-dev
https://golang.org/cl/5538050

13 years agodoc: trivial comment typo fix
Shenghou Ma [Thu, 12 Jan 2012 15:55:23 +0000 (07:55 -0800)]
doc: trivial comment typo fix

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

13 years agogoyacc: fix units.y build breakage
Shenghou Ma [Thu, 12 Jan 2012 15:54:20 +0000 (07:54 -0800)]
goyacc: fix units.y build breakage
This breakage is mainly due to API changes in pkg.
(e.g., package utf8 moved to unicode/utf8;
       remove of strconv.Atof64;
       change character type from int to rune.)
Also correct the usage comment.

This fixes issue 2646.
PS: I don't change the goyacc.go, because I think token type
    should not be force to rune.

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

13 years agogc: avoid false positives when using scalar struct fields.
Rémy Oudompheng [Thu, 12 Jan 2012 11:08:40 +0000 (12:08 +0100)]
gc: avoid false positives when using scalar struct fields.

The escape analysis code does not make a distinction between
scalar and pointers fields in structs. Non-pointer fields
that escape should not make the whole struct escape.

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

13 years agonet/textproto: always copy the data from bufio to avoid corruption
Andrew Gerrand [Thu, 12 Jan 2012 03:15:58 +0000 (14:15 +1100)]
net/textproto: always copy the data from bufio to avoid corruption

Fixes #2621.

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

13 years agoruntime: delete duplicate implementation of pcln walker
Russ Cox [Thu, 12 Jan 2012 02:45:32 +0000 (18:45 -0800)]
runtime: delete duplicate implementation of pcln walker

It's hard enough to get right once.

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

13 years agogc: inlining bug
Russ Cox [Thu, 12 Jan 2012 01:32:02 +0000 (20:32 -0500)]
gc: inlining bug

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

13 years agohtml/template: reenable testcases and fix mis-escaped sequences.
Mike Samuel [Wed, 11 Jan 2012 23:47:03 +0000 (18:47 -0500)]
html/template: reenable testcases and fix mis-escaped sequences.

Tighter octal parsing broke some tests and were disabled in
https://golang.org/cl/5530051

Those tests were broken.  The CSS decoder was supposed to see CSS
hex escape sequences of the form '\' <hex>+, but those escape
sequences were instead being consumed by the template parser.

This change properly escapes those escape sequences, and uses
proper escaping for NULs.

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

13 years agogc: fix inlining bug
Russ Cox [Wed, 11 Jan 2012 22:25:09 +0000 (17:25 -0500)]
gc: fix inlining bug

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

13 years agogo/scanner: 17% faster scanning
Robert Griesemer [Wed, 11 Jan 2012 22:20:32 +0000 (14:20 -0800)]
go/scanner: 17% faster scanning

- Changed the Scan API semantics slightly:
The token literal string is only returned
if the token is a literal, comment, semicolon,
or illegal character. In all other cases, the
token literal value is determined by the token
value.

Clients that care about the token literal value
when not present can always use the following
piece of code:

pos, tok, lit := scanner.Scan()
if lit == "" {
   lit = tok.String()
}

- Changed token.Lookup API to use a string instead
of a []byte argument.

- Both these changes were long-standing TODOs.

- Added BenchmarkScan.

This change permits a faster implementation of Scan
with much fewer string creations:

benchmark                old ns/op    new ns/op    delta
scanner.BenchmarkScan        74404        61457  -17.40%

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

13 years agodoc: update "How to Write Go Code" to use the go tool
Andrew Gerrand [Wed, 11 Jan 2012 21:25:49 +0000 (08:25 +1100)]
doc: update "How to Write Go Code" to use the go tool

R=golang-dev, r, kevlar, rsc
CC=golang-dev
https://golang.org/cl/5534045

13 years agomisc/dashboard/builder: fix comment in http.go
Olivier Duperray [Wed, 11 Jan 2012 21:23:33 +0000 (13:23 -0800)]
misc/dashboard/builder: fix comment in http.go

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

13 years agogc: fix inlining bug
Russ Cox [Wed, 11 Jan 2012 21:21:06 +0000 (13:21 -0800)]
gc: fix inlining bug

Fixes #2682.

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

13 years agocmd/go: change deadline to 10 minutes
Russ Cox [Wed, 11 Jan 2012 20:44:31 +0000 (12:44 -0800)]
cmd/go: change deadline to 10 minutes

1 minute is not enough for the slower builders.

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

13 years agogc: export nil literals without inferred type.
Luuk van Dijk [Wed, 11 Jan 2012 20:26:54 +0000 (21:26 +0100)]
gc: export nil literals without inferred type.

Fixes #2678

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

13 years agogo test: align "no test files" message
Robert Griesemer [Wed, 11 Jan 2012 19:15:36 +0000 (11:15 -0800)]
go test: align "no test files" message

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

13 years agogo/scanner: remove (exported) InsertSemis mode
Robert Griesemer [Wed, 11 Jan 2012 18:06:44 +0000 (10:06 -0800)]
go/scanner: remove (exported) InsertSemis mode

This is a relic from the times when we switched
to automatic semicolon insertion. It's still use-
ful to have a non-exported switch for testing.

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

13 years agocmd/go: fix test documentation
Dmitriy Vyukov [Wed, 11 Jan 2012 17:47:08 +0000 (09:47 -0800)]
cmd/go: fix test documentation

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

13 years agogo/printer: don't crash if AST contains BadXXX nodes
Robert Griesemer [Wed, 11 Jan 2012 16:32:03 +0000 (08:32 -0800)]
go/printer: don't crash if AST contains BadXXX nodes

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

13 years agoMakefile: update openpgp/error -> openpgp/errors
Adam Langley [Wed, 11 Jan 2012 13:39:29 +0000 (08:39 -0500)]
Makefile: update openpgp/error -> openpgp/errors

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

13 years agocrypto/openpgp: assorted cleanups
Adam Langley [Wed, 11 Jan 2012 13:35:32 +0000 (08:35 -0500)]
crypto/openpgp: assorted cleanups

1) Include Szabolcs Nagy's patch which adds serialisation for more
   signature subpackets.
2) Include Szabolcs Nagy's patch which adds functions for making DSA
   keys.
3) Make the random io.Reader an argument to the low-level signature
   functions rather than having them use crypto/rand.
4) Rename crypto/openpgp/error to crypto/openpgp/errors so that it
   doesn't clash with the new error type.

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

13 years agocmd/go: kill test.out after 1 minute
Russ Cox [Wed, 11 Jan 2012 05:01:58 +0000 (21:01 -0800)]
cmd/go: kill test.out after 1 minute

Will have to do better but this is enough to
stop the builders from hanging, I hope.

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

13 years agoruntime: runtime.usleep() bugfix on darwin/amd64 and linux/arm
Shenghou Ma [Wed, 11 Jan 2012 04:48:02 +0000 (20:48 -0800)]
runtime: runtime.usleep() bugfix on darwin/amd64 and linux/arm

pkg/runtime/sys_darwin_amd64.s: fixes syscall select nr
pkg/runtime/sys_linux_arm.s: uses newselect instead of the now unimplemented
        (old) select, also fixes the wrong div/mod statements in runtime.usleep.
Fixes #2633

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

13 years agobuilder: pass through TMPDIR env var, drop DISABLE_NET_TESTS
Andrew Gerrand [Wed, 11 Jan 2012 04:44:20 +0000 (15:44 +1100)]
builder: pass through TMPDIR env var, drop DISABLE_NET_TESTS

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

13 years agoos: work around inlining bug (issue 2678)
Russ Cox [Wed, 11 Jan 2012 04:26:11 +0000 (20:26 -0800)]
os: work around inlining bug (issue 2678)

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

13 years agogo: rely on exit code to tell if test passed
Russ Cox [Wed, 11 Jan 2012 04:13:02 +0000 (20:13 -0800)]
go: rely on exit code to tell if test passed

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

13 years agogc: enable inlining by default
Russ Cox [Wed, 11 Jan 2012 04:08:53 +0000 (20:08 -0800)]
gc: enable inlining by default

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

13 years agonet: fix windows build
Alex Brainman [Wed, 11 Jan 2012 03:55:10 +0000 (14:55 +1100)]
net: fix windows build

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

13 years agoruntime: make garbage collector faster by deleting code
Russ Cox [Wed, 11 Jan 2012 03:49:11 +0000 (19:49 -0800)]
runtime: make garbage collector faster by deleting code

Suggested by Sanjay Ghemawat.  5-20% faster depending
on the benchmark.

Add tree2 garbage benchmark.
Update other garbage benchmarks to build again.

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

13 years agogo/scanner: fix documentation
Robert Griesemer [Wed, 11 Jan 2012 02:31:27 +0000 (18:31 -0800)]
go/scanner: fix documentation

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

13 years agogo/ast: predeclared objects have the Universe/Unsafe scope as Decl
Robert Griesemer [Wed, 11 Jan 2012 02:30:06 +0000 (18:30 -0800)]
go/ast: predeclared objects have the Universe/Unsafe scope as Decl

Makes it possible to easily detect if an Object was predeclared
(as opposed to unresolved).

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

13 years agosyscall: fix windows build
Mikio Hara [Wed, 11 Jan 2012 02:27:09 +0000 (18:27 -0800)]
syscall: fix windows build

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

13 years agoimage: rename image.Tiled to image.Repeated.
Nigel Tao [Wed, 11 Jan 2012 01:35:05 +0000 (12:35 +1100)]
image: rename image.Tiled to image.Repeated.

What package image currently provides is a larger image consisting
of many copies of a smaller image.

More generally, a tiled image could be a quilt consisting of different
smaller images (like Google Maps), or a technique to view a portion of
enormous images without requiring the whole thing in memory.

This richer construct might not ever belong in the standard library (and
is definitely out of scope for Go 1), but I would like the option for
image.Tiled to be its name.

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

13 years agonet: add IP-level socket option helpers for Unix variants
Mikio Hara [Wed, 11 Jan 2012 00:53:32 +0000 (09:53 +0900)]
net: add IP-level socket option helpers for Unix variants

Also reorganize socket options stuff but there are no API behavioral
changes.

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

13 years agoA+C: add Yoshiyuki Kanno (Individual CLA)
Brad Fitzpatrick [Tue, 10 Jan 2012 23:50:44 +0000 (15:50 -0800)]
A+C: add Yoshiyuki Kanno (Individual CLA)

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

13 years agohtml: propagate foreign namespaces only when adding foreign content.
Nigel Tao [Tue, 10 Jan 2012 23:15:40 +0000 (10:15 +1100)]
html: propagate foreign namespaces only when adding foreign content.

Pass tests10.dat, test 31:
<div><svg><path><foreignObject><p></div>a

| <html>
|   <head>
|   <body>
|     <div>
|       <svg svg>
|         <svg path>
|           <svg foreignObject>
|             <p>
|               "a"

Also pass test 32:
<!DOCTYPE html><svg><desc><div><svg><ul>a

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

13 years agoruntime: fix typo in comment
Maxim Pimenov [Tue, 10 Jan 2012 20:56:25 +0000 (12:56 -0800)]
runtime: fix typo in comment

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

13 years agoexp/sql: close Rows on EOF
Brad Fitzpatrick [Tue, 10 Jan 2012 20:51:27 +0000 (12:51 -0800)]
exp/sql: close Rows on EOF

Fixes #2624

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

13 years agogc: test that asserts closures are not wrapped when they don't have closure vars.
Luuk van Dijk [Tue, 10 Jan 2012 20:47:22 +0000 (21:47 +0100)]
gc: test that asserts closures are not wrapped when they don't have closure vars.

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

13 years agogc: inlining fixes
Luuk van Dijk [Tue, 10 Jan 2012 20:24:31 +0000 (21:24 +0100)]
gc: inlining fixes

flag -l means: inlining on, -ll inline with early typecheck
-l lazily typechecks imports on use and re-export, nicer for debugging
-lm produces output suitable for errchk tests, repeated -mm... increases inl.c's verbosity
export processed constants, instead of originals
outparams get ->inlvar too, and initialized to zero
fix shared rlist bug, that lead to typecheck messing up the patched tree
properly handle non-method calls to methods T.meth(t, a...)
removed embryonic code to handle closures in inlined bodies
also inline calls inside closures (todo: move from phase 6b to 4)

Fixes #2579.

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

13 years agoruntime: distinct panic message for call of nil func value
Russ Cox [Tue, 10 Jan 2012 19:46:57 +0000 (11:46 -0800)]
runtime: distinct panic message for call of nil func value

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

13 years agoA+C: add Shenghou Ma (Individual CLA)
Brad Fitzpatrick [Tue, 10 Jan 2012 19:13:27 +0000 (11:13 -0800)]
A+C: add Shenghou Ma (Individual CLA)

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

13 years agoruntime: regenerate defs_darwin_{386,amd64}.h
Dave Cheney [Tue, 10 Jan 2012 17:48:10 +0000 (09:48 -0800)]
runtime: regenerate defs_darwin_{386,amd64}.h

Regenerated under Lion 10.7.2 amd64.
Also tested on Snow Leopart 10.6.8 386.

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

13 years agogo: fix typo in comment
Maxim Pimenov [Tue, 10 Jan 2012 15:43:48 +0000 (07:43 -0800)]
go: fix typo in comment

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

13 years agogc: Nicer errors before miscompiling.
Luuk van Dijk [Tue, 10 Jan 2012 10:19:22 +0000 (11:19 +0100)]
gc: Nicer errors before miscompiling.

This fixes issue 2444.

A big cleanup of all 31/32bit size boundaries i'll leave for another cl though.  (see also issue 1700).

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

13 years agogc: disallow declaration of variables outside package.
Luuk van Dijk [Tue, 10 Jan 2012 10:18:56 +0000 (11:18 +0100)]
gc: disallow declaration of variables outside package.

Fixes #2231.

Declaring main.i in package main in the same way already triggers syntax errors.

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

13 years agogc: fix stray %#N in error message
Luuk van Dijk [Tue, 10 Jan 2012 10:09:04 +0000 (11:09 +0100)]
gc: fix stray %#N in error message

Fixes #2639.

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

13 years agogc: omit runtime.closure wrap for closures without closure variables
Luuk van Dijk [Tue, 10 Jan 2012 10:07:35 +0000 (11:07 +0100)]
gc: omit runtime.closure wrap for closures without closure variables

Fixes #1894.

test/closure.go's test for newfunc already covers this.

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

13 years agoundo CL 5530063 / 1d7295fdf62e
Mikio Hara [Tue, 10 Jan 2012 07:11:31 +0000 (16:11 +0900)]
undo CL 5530063 / 1d7295fdf62e

runtime: enable runtime.ncpu on FreeBSD

««« original CL description
cmd/go: fix freebsd build

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

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

13 years agoruntime: enable runtime.ncpu on FreeBSD
Devon H. O'Dell [Tue, 10 Jan 2012 06:39:17 +0000 (17:39 +1100)]
runtime: enable runtime.ncpu on FreeBSD

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

13 years agocmd/go: fix freebsd build
Mikio Hara [Tue, 10 Jan 2012 05:47:20 +0000 (14:47 +0900)]
cmd/go: fix freebsd build

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

13 years agocmd/go: add -p flag for parallelism (like make -j)
Russ Cox [Tue, 10 Jan 2012 05:06:31 +0000 (21:06 -0800)]
cmd/go: add -p flag for parallelism (like make -j)

On my MacBookAir4,1:

19.94r   go install -a -p 1 std
12.36r   go install -a -p 2 std
9.76r   go install -a -p 3 std
10.77r   go install -a -p 4 std

86.57r   go test -p 1 std -short
52.69r   go test -p 2 std -short
43.75r   go test -p 3 std -short
40.44r   go test -p 4 std -short

157.50r   go test -p 1 std
99.58r   go test -p 2 std
87.24r   go test -p 3 std
80.18r   go test -p 4 std

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

13 years agoruntime: add NumCPU
Russ Cox [Tue, 10 Jan 2012 02:45:59 +0000 (18:45 -0800)]
runtime: add NumCPU

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

13 years agostrconv: return ErrSyntax when unquoting illegal octal sequences. This
Sameer Ajmani [Tue, 10 Jan 2012 00:55:18 +0000 (19:55 -0500)]
strconv: return ErrSyntax when unquoting illegal octal sequences.  This
is consistent with what the Go compiler returns when such sequences
appear in string literals.

Fixes #2658.

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

13 years agospec: pointer comparison for pointers to 0-sized variables
Robert Griesemer [Tue, 10 Jan 2012 00:54:24 +0000 (16:54 -0800)]
spec: pointer comparison for pointers to 0-sized variables

- define "0-sized"
- add clarifying sentence to pointer comparison
- removed notion "location" which was used only in pointer comparisons
  and which was never defined

Fixes #2620.

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

13 years agosyscall: make Environ return original order
Brad Fitzpatrick [Tue, 10 Jan 2012 00:51:20 +0000 (16:51 -0800)]
syscall: make Environ return original order

Fixes #2619

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

13 years agocmd/go: add -v flag to build and install
Russ Cox [Tue, 10 Jan 2012 00:44:01 +0000 (16:44 -0800)]
cmd/go: add -v flag to build and install

The -v flag prints the names of packages as they are built/installed.

Use -v in make.bash/run.bash to avoid a silent pause during
the build while Go code is being compiled.

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

13 years agogo: add ... patterns in import path arguments
Russ Cox [Tue, 10 Jan 2012 00:23:00 +0000 (16:23 -0800)]
go: add ... patterns in import path arguments

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

13 years agogo/doc: first steps towards cleaning up go/doc
Robert Griesemer [Tue, 10 Jan 2012 00:14:01 +0000 (16:14 -0800)]
go/doc: first steps towards cleaning up go/doc

- separated exported data structures from doc reader
  by extracting all exported data structures into doc.go
  and moving the implementation into reader.go
- added missing documentation comments
- no API or semantic changes (but moved positions of
  PackageDoc.Doc and TypeDoc.Decl field up for consistency)
- runs all tests

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

13 years agohtml: foreign element HTML integration points, tag name adjustment,
Nigel Tao [Tue, 10 Jan 2012 00:06:09 +0000 (11:06 +1100)]
html: foreign element HTML integration points, tag name adjustment,
shorten the MathML namespace abbreviation from "mathml" to "math".
Python's html5lib uses "mathml", but I think that that is an internal
implementation detail; the test cases use "math".

Pass tests10.dat, test 30:
<div><svg><path><foreignObject><math></div>a

| <html>
|   <head>
|   <body>
|     <div>
|       <svg svg>
|         <svg path>
|           <svg foreignObject>
|             <math math>
|               "a"

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

13 years agocmd/go: fix import directory list for compilation
Russ Cox [Mon, 9 Jan 2012 23:38:07 +0000 (15:38 -0800)]
cmd/go: fix import directory list for compilation

This fixes the most annoying bug in the go command,
that 'go build' sometimes ignored packages it had just
rebuilt in favor of stale installed ones.

This part of the code needs more thought, but this small
change is an important improvement.

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

13 years agosyscall: ignore godefs input when building on Plan 9
Anthony Martin [Mon, 9 Jan 2012 23:09:40 +0000 (15:09 -0800)]
syscall: ignore godefs input when building on Plan 9

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

13 years agoos: add ModeCharDevice
Russ Cox [Mon, 9 Jan 2012 22:22:53 +0000 (14:22 -0800)]
os: add ModeCharDevice

This should make conversion from Unix mode
to os.FileMode and back not lossy.

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

13 years agocrypto/openpgp: truncate hashes before checking DSA signatures.
Adam Langley [Mon, 9 Jan 2012 21:57:51 +0000 (16:57 -0500)]
crypto/openpgp: truncate hashes before checking DSA signatures.

I didn't believe that OpenPGP allowed > SHA-1 with DSA, but it does and
so we need to perform hash truncation.

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

13 years agotext/template: handle panic values that are not errors.
Rémy Oudompheng [Mon, 9 Jan 2012 20:54:31 +0000 (12:54 -0800)]
text/template: handle panic values that are not errors.

The recover code assumes that the panic() argument was
an error, but it is usually a simple string.
Fixes #2663.

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

13 years agoencoding/gob: fix panic when decoding []byte to incompatible slice types
Alexey Borzenkov [Mon, 9 Jan 2012 20:52:03 +0000 (12:52 -0800)]
encoding/gob: fix panic when decoding []byte to incompatible slice types

Fixes #2662.

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

13 years agogc: remove now redundant typecheck of ->ninit on switches.
Luuk van Dijk [Mon, 9 Jan 2012 20:42:24 +0000 (21:42 +0100)]
gc: remove now redundant typecheck of ->ninit on switches.

Fixes #2576.

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

13 years agocgo: if value for constant did not parse, get it from DWARF info
Ian Lance Taylor [Mon, 9 Jan 2012 19:22:26 +0000 (11:22 -0800)]
cgo: if value for constant did not parse, get it from DWARF info

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

13 years agomath/big: simplify fast string conversion
Robert Griesemer [Mon, 9 Jan 2012 19:20:09 +0000 (11:20 -0800)]
math/big: simplify fast string conversion

- use slice ops for convertWords instead of lo/hi boundaries
- always compute leading zeroes (simplifies logic significantly),
  but remove them once, at the end (since leafSize is small, the
  worst-case scenario is not adding significant overhead)
- various comment cleanups (specifically, replaced direct -> iterative,
  and indirect -> recursive)
- slightly faster overall for -bench=String

(This CL incorporates the changes re: my comments to CL 5418047
https://golang.org/cl/5418047/ )

benchmark                          old ns/op    new ns/op    delta
big.BenchmarkString10Base2               519          527   +1.54%
big.BenchmarkString100Base2             2279         2158   -5.31%
big.BenchmarkString1000Base2           18475        17323   -6.24%
big.BenchmarkString10000Base2         178248       166219   -6.75%
big.BenchmarkString100000Base2       1548494      1431587   -7.55%
big.BenchmarkString10Base8               415          422   +1.69%
big.BenchmarkString100Base8             1025          978   -4.59%
big.BenchmarkString1000Base8            6822         6428   -5.78%
big.BenchmarkString10000Base8          64598        61065   -5.47%
big.BenchmarkString100000Base8        593788       549150   -7.52%
big.BenchmarkString10Base10              654          645   -1.38%
big.BenchmarkString100Base10            1863         1835   -1.50%
big.BenchmarkString1000Base10          12099        11981   -0.98%
big.BenchmarkString10000Base10         57601        56888   -1.24%
big.BenchmarkString100000Base10     20123120     19827890   -1.47%
big.BenchmarkString10Base16              358          362   +1.12%
big.BenchmarkString100Base16             815          776   -4.79%
big.BenchmarkString1000Base16           4710         4421   -6.14%
big.BenchmarkString10000Base16         43938        40968   -6.76%
big.BenchmarkString100000Base16       406307       373930   -7.97%

R=michael.jones, mtj
CC=golang-dev
https://golang.org/cl/5432090

13 years agodoc: use 2012 for year in model standard copyright header
Peter Mundy [Mon, 9 Jan 2012 18:47:28 +0000 (10:47 -0800)]
doc: use 2012 for year in model standard copyright header

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

13 years agogo-mode.el: fix syntax highlighting of backticks
Florian Weimer [Mon, 9 Jan 2012 17:58:29 +0000 (12:58 -0500)]
go-mode.el: fix syntax highlighting of backticks

Instead of syntax-tables, an extended go-mode-cs is used for
from a font-lock callback.

Cache invalidation must happen in a before-change-function
because font-lock runs in an after-change-function, potentially
before the cache invalidation takes place.

Performance is reasonable, even with src/pkg/html/entity.go
and test/fixedbugs/bug257.go.

Fixes #2330.

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

13 years agoundo CL 5504108 / 0edee03791f4
Russ Cox [Mon, 9 Jan 2012 17:45:08 +0000 (09:45 -0800)]
undo CL 5504108 / 0edee03791f4

breaks 386 build

««« original CL description
gc: put limit on size of exported recursive interface

Prevents edge-case recursive types from consuming excessive memory.

Fixes #1909.

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

»»»

R=lvd, lvd
CC=golang-dev
https://golang.org/cl/5534049

13 years agogc: put limit on size of exported recursive interface
Lorenzo Stoakes [Mon, 9 Jan 2012 16:48:53 +0000 (11:48 -0500)]
gc: put limit on size of exported recursive interface

Prevents edge-case recursive types from consuming excessive memory.

Fixes #1909.

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

13 years agosyscall: Linux-only support for parent death signal
Albert Strasheim [Mon, 9 Jan 2012 12:37:46 +0000 (21:37 +0900)]
syscall: Linux-only support for parent death signal

As discussed in this thread:

https://groups.google.com/group/golang-dev/browse_thread/thread/5b76b7700265a787

I've tried to come up with a solution that is minimally invasive for the platforms that don't support "parent death signal", without splitting up exec_unix.go.

See also: http://www.win.tue.nl/~aeb/linux/lk/lk-5.html#ss5.8

R=rsc, dave, borman, iant, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5487061

13 years agodoc: only trim newlines in tmpltohtml, gofmt progs
Andrew Gerrand [Mon, 9 Jan 2012 09:05:34 +0000 (20:05 +1100)]
doc: only trim newlines in tmpltohtml, gofmt progs

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

13 years agogo/build: handle and warn of duplicate GOPATH entries
Andrew Gerrand [Mon, 9 Jan 2012 03:24:05 +0000 (14:24 +1100)]
go/build: handle and warn of duplicate GOPATH entries

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

13 years agodoc: float -> float64 in Effective Go template
Andrew Gerrand [Mon, 9 Jan 2012 01:48:42 +0000 (12:48 +1100)]
doc: float -> float64 in Effective Go template

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

13 years agodoc: float -> float64 in Effective Go
Jeff R. Allen [Mon, 9 Jan 2012 00:53:20 +0000 (11:53 +1100)]
doc: float -> float64 in Effective Go

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

13 years agowindows: use ArbitraryUserPointer as TLS slot
Wei Guangjing [Mon, 9 Jan 2012 00:23:07 +0000 (11:23 +1100)]
windows: use ArbitraryUserPointer as TLS slot

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

13 years agoencoding/asn1: document support for *big.Int
Florian Weimer [Sun, 8 Jan 2012 15:02:23 +0000 (10:02 -0500)]
encoding/asn1: document support for *big.Int
        Also add basic tests.

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

13 years agotime: fix godoc for After and NewTicker.
Sameer Ajmani [Sun, 8 Jan 2012 01:53:53 +0000 (20:53 -0500)]
time: fix godoc for After and NewTicker.

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

13 years agogc: improve unsafe.Pointer type-check error messages
Ryan Hitchman [Fri, 6 Jan 2012 22:34:16 +0000 (14:34 -0800)]
gc: improve unsafe.Pointer type-check error messages

Fixes #2627.

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

13 years agoA+C: add sameer@golang.org to CONTRIBUTORS.
Sameer Ajmani [Fri, 6 Jan 2012 22:11:51 +0000 (14:11 -0800)]
A+C: add sameer@golang.org to CONTRIBUTORS.

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

13 years agoAdd Szabolcs Nagy as a contributor.
Adam Langley [Fri, 6 Jan 2012 17:38:01 +0000 (12:38 -0500)]
Add Szabolcs Nagy as a contributor.

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

13 years agosort: eliminate extra Len() call
Robert Griesemer [Fri, 6 Jan 2012 02:40:17 +0000 (18:40 -0800)]
sort: eliminate extra Len() call

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

13 years agovarious: fix prints
Robert Hencke [Fri, 6 Jan 2012 02:38:01 +0000 (18:38 -0800)]
various: fix prints

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

13 years agogoinstall: fix test data
Andrew Gerrand [Thu, 5 Jan 2012 22:48:03 +0000 (09:48 +1100)]
goinstall: fix test data

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

13 years agocmd/go: Pass arguments to command for run
Eric Eisner [Thu, 5 Jan 2012 22:23:00 +0000 (09:23 +1100)]
cmd/go: Pass arguments to command for run

Command arguments are separated from input .go file arguments
by a -- separator.

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

13 years agodoc: add Slices: usage and internals article
Andrew Gerrand [Thu, 5 Jan 2012 22:21:43 +0000 (09:21 +1100)]
doc: add Slices: usage and internals article

Originally published on the Go blog on 5 Jan 2011:
http://blog.golang.org/2011/01/go-slices-usage-and-internals.html

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

13 years agogoinstall: use correct checkout URL for Google Code svn repos
Andrew Gerrand [Thu, 5 Jan 2012 22:20:59 +0000 (09:20 +1100)]
goinstall: use correct checkout URL for Google Code svn repos

Fixes #2655.

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

13 years agodoc: trim spaces from code snippets
Andrew Gerrand [Thu, 5 Jan 2012 22:20:31 +0000 (09:20 +1100)]
doc: trim spaces from code snippets

gofmt likes to put lines like
  // STOP OMIT
two blank lines from a closing brace, creating an ugly space inside
<pre> blocks in some of these files. This change resolves this issue.

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