]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agogofix: add -debug flag for quicker diagnosis of internal errors
Robert Griesemer [Wed, 25 Jan 2012 20:26:19 +0000 (15:26 -0500)]
gofix: add -debug flag for quicker diagnosis of internal errors

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

13 years agocodereview: more fixes
Russ Cox [Wed, 25 Jan 2012 19:46:10 +0000 (14:46 -0500)]
codereview: more fixes

Python and Mercurial are a matched pair.

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

13 years agocodereview: support for subrepositories
Russ Cox [Wed, 25 Jan 2012 19:32:10 +0000 (14:32 -0500)]
codereview: support for subrepositories

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

13 years agogo/printer: factor some frequently used code
Robert Griesemer [Wed, 25 Jan 2012 18:45:16 +0000 (10:45 -0800)]
go/printer: factor some frequently used code

Added a cache to compensate for extra call overhead.
go test -bench=Print marginally faster (in the noise).

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

13 years agogo/printer, gofmt: respect line breaks in signatures
Robert Griesemer [Wed, 25 Jan 2012 18:21:13 +0000 (10:21 -0800)]
go/printer, gofmt: respect line breaks in signatures

No changes when applying gofmt to src, misc.

Fixes #2597.

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

13 years agogo/doc: test case for corner case (override of predecl. type)
Robert Griesemer [Wed, 25 Jan 2012 17:54:10 +0000 (09:54 -0800)]
go/doc: test case for corner case (override of predecl. type)

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

13 years agogo/doc: clean rewrite of go/doc internals
Robert Griesemer [Wed, 25 Jan 2012 17:53:26 +0000 (09:53 -0800)]
go/doc: clean rewrite of go/doc internals

The implementation is divided into 4 phases:
1) export filtering of an incoming AST if necessary (exports.go)
2) reading of a possibly filtered AST (reader.go: type reader)
3) method set computation (reader.go)
4) sorting and creation of final documentation (reader.go)

In contrast to the old implementation, the presentation data
(Names, Docs, Decls, etc.) are created immediately upon reading
the respective AST node. Also, all types are collected (embedded
or not) in a uniform way.

Once the entire AST has been processed, all methods and types
have been collected and the method sets for each type can be
computed (phase 3).

To produce the final documentation, the method sets and value
maps are sorted.

There are no API changes. Passes the existing test suite unchanged.

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

13 years agogofmt: fix test.sh
Robert Griesemer [Wed, 25 Jan 2012 16:58:41 +0000 (08:58 -0800)]
gofmt: fix test.sh

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

13 years agoos: pass tests on Plan 9 again
Fazlul Shahriar [Wed, 25 Jan 2012 08:15:44 +0000 (00:15 -0800)]
os: pass tests on Plan 9 again

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

13 years agoruntime: move NumCPU declaration into debug.go.
David Symonds [Wed, 25 Jan 2012 03:13:11 +0000 (14:13 +1100)]
runtime: move NumCPU declaration into debug.go.

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

13 years agoarchive/tar: fix race in TestNonSeekable
Joel Sing [Wed, 25 Jan 2012 02:44:53 +0000 (13:44 +1100)]
archive/tar: fix race in TestNonSeekable

Reimplement the test based on code from adg@golang.org.

The previous version has a race since the file is closed via defer
rather than in the go routine. This meant that the file could be
closed before the go routine has actually received io.EOF. It then
receives EBADF and continues to do zero-byte writes to the pipe.

This addresses an issue seen on FreeBSD and OpenBSD, where the test
passes but exits with a SIGPIPE, resulting in a failure.

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

13 years agodoc/go1: mime, filepath.Walk
Rob Pike [Wed, 25 Jan 2012 01:02:06 +0000 (17:02 -0800)]
doc/go1: mime, filepath.Walk

R=golang-dev, gri, bradfitz, adg
CC=golang-dev
https://golang.org/cl/5571060

13 years agogodoc: update metadata upon launch
Andrew Gerrand [Wed, 25 Jan 2012 00:56:31 +0000 (11:56 +1100)]
godoc: update metadata upon launch

Without this change it's possible to launch godoc,
immediately GET /, and see a directory listing instead of root.html

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

13 years agogo/scanner: Use explicit scanner.Mode type.
Robert Griesemer [Wed, 25 Jan 2012 00:49:03 +0000 (16:49 -0800)]
go/scanner: Use explicit scanner.Mode type.

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

13 years agonet/http: parse CONNECT requests
Andrew Balholm [Wed, 25 Jan 2012 00:42:00 +0000 (11:42 +1100)]
net/http: parse CONNECT requests

Fixes #2755

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

13 years agodoc/go1: add more info about hash and net changes, delete reference to html
Rob Pike [Wed, 25 Jan 2012 00:36:40 +0000 (16:36 -0800)]
doc/go1: add more info about hash and net changes, delete reference to html

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

13 years agogo/parser: Use explicit parser.Mode type.
Robert Griesemer [Wed, 25 Jan 2012 00:36:20 +0000 (16:36 -0800)]
go/parser: Use explicit parser.Mode type.

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

13 years agohtml: move the HTML parser to an exp/html package. The parser is a
Nigel Tao [Tue, 24 Jan 2012 23:54:59 +0000 (10:54 +1100)]
html: move the HTML parser to an exp/html package. The parser is a
work in progress, and we are not ready to freeze its API for Go 1.

Package html still exists, containing just two functions: EscapeString
and UnescapeString.

Both the packages at exp/html and html are "package html". The former
is a superset of the latter.

At some point in the future, the exp/html code will move back into
html, once we have finalized the parser API.

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

13 years agoencoding/xml: remove Marshaler support
Gustavo Niemeyer [Tue, 24 Jan 2012 23:51:15 +0000 (21:51 -0200)]
encoding/xml: remove Marshaler support

Marshaler has a number of open areas that need
further thought (e.g. it doesn't handle attributes,
it's supposed to handle tag names internally but has
no information to do so, etc).

We're removing it now and will bring it back with an
interface that covers these aspects, after Go 1.

Related to issue 2771, but doesn't fix it.

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

13 years agomath/big: add examples for Rat and Int's SetString and Scan methods
Andrew Gerrand [Tue, 24 Jan 2012 23:29:44 +0000 (10:29 +1100)]
math/big: add examples for Rat and Int's SetString and Scan methods

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

13 years agoencoding/xml: add docs for ignoring tag
Gustavo Niemeyer [Tue, 24 Jan 2012 23:04:40 +0000 (21:04 -0200)]
encoding/xml: add docs for ignoring tag

That was supposed to be in the original CL, but missed
the files.

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

13 years agotext/template: add example for Template
Andrew Gerrand [Tue, 24 Jan 2012 22:24:25 +0000 (09:24 +1100)]
text/template: add example for Template

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

13 years agoencoding/binary: document that PutVarint, PutUvarint may panic
Brad Fitzpatrick [Tue, 24 Jan 2012 22:19:59 +0000 (14:19 -0800)]
encoding/binary: document that PutVarint, PutUvarint may panic

Fixes #2628

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

13 years agonet: actually reset deadline when time is zero
Brad Fitzpatrick [Tue, 24 Jan 2012 22:06:12 +0000 (14:06 -0800)]
net: actually reset deadline when time is zero

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

13 years agobuild: do not build all C compilers
Shenghou Ma [Tue, 24 Jan 2012 20:03:41 +0000 (15:03 -0500)]
build: do not build all C compilers
        In order to allow buildscript.sh to generate buildscripts for all
        $GOOS/$GOARCH combinations, we have to generate dummy files for cmd/go.
        Fixes #2586.

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

13 years agorename FooError vars to ErrFoo
Brad Fitzpatrick [Tue, 24 Jan 2012 19:48:48 +0000 (11:48 -0800)]
rename FooError vars to ErrFoo

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

13 years agotest: Add the usual Copyright notice.
Olivier Duperray [Tue, 24 Jan 2012 19:48:15 +0000 (14:48 -0500)]
test: Add the usual Copyright notice.

Fixes #2759.

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

13 years agogo/build: typo
Brad Fitzpatrick [Tue, 24 Jan 2012 19:24:55 +0000 (11:24 -0800)]
go/build: typo

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

13 years agocmd/go: fix get github
Russ Cox [Tue, 24 Jan 2012 19:15:37 +0000 (14:15 -0500)]
cmd/go: fix get github

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

13 years agocompress/flate: increase the length of hash table from 1<<15 to 1<<17. 0%-16% speedup.
Ivan Krasin [Tue, 24 Jan 2012 18:52:45 +0000 (13:52 -0500)]
compress/flate: increase the length of hash table from 1<<15 to 1<<17. 0%-16% speedup.

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

13 years agocrypto: rename some FooError to ErrFoo
Brad Fitzpatrick [Tue, 24 Jan 2012 16:32:43 +0000 (08:32 -0800)]
crypto: rename some FooError to ErrFoo

Also, add an explicit error type when the right hand side is an unexported
function.

R=golang-dev, gri, rogpeppe, agl, rsc
CC=golang-dev
https://golang.org/cl/5564048

13 years agogc: static implements check on typeswitches only applies to concrete case types.
Luuk van Dijk [Tue, 24 Jan 2012 12:53:00 +0000 (13:53 +0100)]
gc: static implements check on typeswitches only applies to concrete case types.

Fixes #2700.

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

13 years agoencoding/xml: bring API closer to other packages
Gustavo Niemeyer [Tue, 24 Jan 2012 03:10:32 +0000 (01:10 -0200)]
encoding/xml: bring API closer to other packages

Includes gofix module. The only case not covered should be
xml.Unmarshal, since it remains with a similar interface, and
would require introspecting the type of its first argument
better.

Fixes #2626.

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

13 years agogo/doc: removed unused field "Type.Type"
Robert Griesemer [Tue, 24 Jan 2012 00:53:19 +0000 (16:53 -0800)]
go/doc: removed unused field "Type.Type"

CL 5572043 removed the last uses of this field.
The information is readily available from Type.Decl.

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

13 years agodoc/go1: image changes
Rob Pike [Tue, 24 Jan 2012 00:11:49 +0000 (16:11 -0800)]
doc/go1: image changes

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

13 years agolib/godoc: use Type.Name directly
Robert Griesemer [Tue, 24 Jan 2012 00:08:05 +0000 (16:08 -0800)]
lib/godoc: use Type.Name directly

Also: remove an unused template variable declaration.

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

13 years agomath/big: slight improvement to algorithm used for internal bitLen function
David G. Andersen [Mon, 23 Jan 2012 21:46:28 +0000 (13:46 -0800)]
math/big: slight improvement to algorithm used for internal bitLen function

The bitLen function currently shifts out blocks of 8 bits at a time.
This change replaces this sorta-linear algorithm with a log(N)
one (shift out 16 bits, then 8, then 4, then 2, then 1).
I left the start of it linear at 16 bits at a time so that
the function continues to work with 32 or 64 bit values
without any funkiness.
The algorithm is similar to several of the nlz ("number of
leading zeros") algorithms from "Hacker's Delight" or the
"bit twiddling hacks" pages.

Doesn't make a big difference to the existing benchmarks, but
I'm using the code in a different context that calls bitLen
much more often, so it seemed worthwhile making the existing
codebase faster so that it's a better building block.

Microbenchmark results on a 64-bit Macbook Pro using 6g from weekly.2012-01-20:

benchmark                old ns/op    new ns/op    delta
big.BenchmarkBitLen0             4            6  +50.12%
big.BenchmarkBitLen1             4            6  +33.91%
big.BenchmarkBitLen2             6            6   +3.05%
big.BenchmarkBitLen3             7            6  -19.05%
big.BenchmarkBitLen4             9            6  -30.19%
big.BenchmarkBitLen5            11            6  -42.23%
big.BenchmarkBitLen8            16            6  -61.78%
big.BenchmarkBitLen9             5            6  +18.29%
big.BenchmarkBitLen16           18            7  -60.99%
big.BenchmarkBitLen17            7            6   -4.64%
big.BenchmarkBitLen31           19            7  -62.49%

On an ARM machine (with the previous weekly):

benchmark                old ns/op    new ns/op    delta
big.BenchmarkBitLen0            37           50  +36.56%
big.BenchmarkBitLen1            59           51  -13.69%
big.BenchmarkBitLen2            74           59  -20.40%
big.BenchmarkBitLen3            92           60  -34.89%
big.BenchmarkBitLen4           110           59  -46.09%
big.BenchmarkBitLen5           127           60  -52.68%
big.BenchmarkBitLen8           181           59  -67.24%
big.BenchmarkBitLen9            78           60  -23.05%
big.BenchmarkBitLen16          199           69  -65.13%
big.BenchmarkBitLen17           91           70  -23.17%
big.BenchmarkBitLen31          210           95  -54.43%

R=golang-dev, dave, edsrzf, gri
CC=golang-dev
https://golang.org/cl/5570044

13 years agoexp/ebnflint: test spec during 'go test'
Russ Cox [Mon, 23 Jan 2012 21:35:25 +0000 (16:35 -0500)]
exp/ebnflint: test spec during 'go test'

This avoids the need for a custom Makefile.

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

13 years agocmd/go: add missing files (fix build)
Russ Cox [Mon, 23 Jan 2012 20:24:20 +0000 (15:24 -0500)]
cmd/go: add missing files (fix build)

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

13 years agocmd/go: implement go get + bug fixes
Russ Cox [Mon, 23 Jan 2012 20:16:51 +0000 (15:16 -0500)]
cmd/go: implement go get + bug fixes

Move error information into Package struct, so that
a package can be returned even if a dependency failed
to load or did not exist.  This makes it possible to run
'go fix' or 'go fmt' on packages with broken dependencies
or missing imports.  It also enables go get -fix.
The new go list -e flag lets go list process those package
errors as normal data.

Change p.Doc to be first sentence of package doc, not
entire package doc.  Makes go list -json or
go list -f '{{.ImportPath}} {{.Doc}}' much more reasonable.

The go tool now depends on http, which means also
net and crypto/tls, both of which use cgo.  Trying to
make the build scripts that build the go tool understand
and handle cgo is too much work.  Instead, we build
a stripped down version of the go tool, compiled as go_bootstrap,
that substitutes an error stub for the usual HTTP code.
The buildscript builds go_bootstrap, go_bootstrap builds
the standard packages and commands, including the full
including-HTTP-support go tool, and then go_bootstrap
gets deleted.

Also handle the case where the buildscript needs updating
during all.bash: if it fails but a go command can be found on
the current $PATH, try to regenerate it.  This gracefully
handles situations like adding a new file to a package
used by the go tool.

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

13 years agogo/build: add BuildTags to Context, allow !tag
Russ Cox [Mon, 23 Jan 2012 20:16:38 +0000 (15:16 -0500)]
go/build: add BuildTags to Context, allow !tag

This lets the client of go/build specify additional tags that
can be recognized in a // +build directive.  For example,
a build for a custom environment like App Engine might
include "appengine" in the BuildTags list, so that packages
can be written with some files saying

        // +build appengine   (build only on app engine)

or

        // +build !appengine  (build only when NOT on app engine)

App Engine here is just a hypothetical context.  I plan to use
this in the cmd/go sources to distinguish the bootstrap version
of cmd/go (which will not use networking) from the full version
using a custom tag.  It might also be useful in App Engine.

Also, delete Build and Script, which we did not end up using for
cmd/go and which never got turned on for real in goinstall.

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

13 years agogc: avoid DOT in error messages
Russ Cox [Mon, 23 Jan 2012 20:10:53 +0000 (15:10 -0500)]
gc: avoid DOT in error messages

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

13 years agocgo: -cdefs should translate unsafe.Pointer to void *
Shenghou Ma [Mon, 23 Jan 2012 19:45:30 +0000 (14:45 -0500)]
cgo: -cdefs should translate unsafe.Pointer to void *
        Fixes #2454.

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

13 years agogo/doc: test all operation modes
Robert Griesemer [Mon, 23 Jan 2012 18:41:54 +0000 (10:41 -0800)]
go/doc: test all operation modes

Golden files have extension .d.golden where d is the mode value (0 or 1 for now)
(i.e., testdata/file.out is now testdata/file.0.golden, and there is a new file
testdata/file.1.golden for each testcase)

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

13 years agoexp/norm: fixes a subtle bug introduced by change 10087: random offset
Marcel van Lohuizen [Mon, 23 Jan 2012 18:36:52 +0000 (19:36 +0100)]
exp/norm: fixes a subtle bug introduced by change 10087: random offset
for map iteration.  New code makes table output predictable and fixes
bug.

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

13 years agonet: consistent OpError message
Mikio Hara [Mon, 23 Jan 2012 17:59:43 +0000 (02:59 +0900)]
net: consistent OpError message

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

13 years agodashboard: fix -commit for new xml package
Russ Cox [Mon, 23 Jan 2012 16:50:39 +0000 (11:50 -0500)]
dashboard: fix -commit for new xml package

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

13 years agoCONTRIBUTORS: add Alexandru Moșoi <brtzsnr@gmail.com>
Rob Pike [Mon, 23 Jan 2012 16:49:30 +0000 (08:49 -0800)]
CONTRIBUTORS: add Alexandru Moșoi <brtzsnr@gmail.com>
Google contributor.

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

13 years agogob: annotate debug.go so it's not normally built
Rob Pike [Mon, 23 Jan 2012 16:40:34 +0000 (08:40 -0800)]
gob: annotate debug.go so it's not normally built
So it's not included in the package by the go tool.

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

13 years agospec: function invocation, panic on *nil
Rob Pike [Mon, 23 Jan 2012 16:40:13 +0000 (08:40 -0800)]
spec: function invocation, panic on *nil
Document that indirection through a nil pointer will panic.
Explain function invocation.
This section will need more work, but it's a start.

Fixes #1865.
Fixes #2252.

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

13 years agoFAQ: update to Go 1.
Rob Pike [Mon, 23 Jan 2012 16:39:53 +0000 (08:39 -0800)]
FAQ: update to Go 1.

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

13 years agogc: missed typecheck in subscripting a const string.
Luuk van Dijk [Mon, 23 Jan 2012 15:57:12 +0000 (16:57 +0100)]
gc: missed typecheck in subscripting a const string.

Fixes #2674.

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

13 years agogc: handle function calls in arguments to builtin complex operations.
Luuk van Dijk [Mon, 23 Jan 2012 15:56:57 +0000 (16:56 +0100)]
gc: handle function calls in arguments to builtin complex operations.

Fixes #2582

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

13 years agocompress/flate: delete unused util functions.
Ivan Krasin [Mon, 23 Jan 2012 15:31:51 +0000 (10:31 -0500)]
compress/flate: delete unused util functions.

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

13 years agold: fix Mach-O code signing for non-cgo binaries
Mikkel Krautz [Mon, 23 Jan 2012 14:42:09 +0000 (09:42 -0500)]
ld: fix Mach-O code signing for non-cgo binaries

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

13 years agocompress/flate: use append instead of slice+counter.
Ivan Krasin [Mon, 23 Jan 2012 14:26:14 +0000 (09:26 -0500)]
compress/flate: use append instead of slice+counter.

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

13 years agocompress/flate: reduce memory pressure at cost of additional arithmetic operation.
Ivan Krasin [Mon, 23 Jan 2012 14:19:39 +0000 (09:19 -0500)]
compress/flate: reduce memory pressure at cost of additional arithmetic operation.

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

13 years agogc: fix recursion loop in interface comparison
Russ Cox [Mon, 23 Jan 2012 14:19:02 +0000 (09:19 -0500)]
gc: fix recursion loop in interface comparison

iant's idea.

Fixes #2745.

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

13 years agogodoc: log node printing error
Robert Griesemer [Mon, 23 Jan 2012 03:36:34 +0000 (19:36 -0800)]
godoc: log node printing error

Invaluable when changing template files.

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

13 years agoencoding/xml: support ignoring fields with "-"
Gustavo Niemeyer [Mon, 23 Jan 2012 03:34:35 +0000 (01:34 -0200)]
encoding/xml: support ignoring fields with "-"

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

13 years agoencoding/xml: minor doc fixup
Gustavo Niemeyer [Mon, 23 Jan 2012 03:32:07 +0000 (01:32 -0200)]
encoding/xml: minor doc fixup

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

13 years agogo/doc: add more test cases
Robert Griesemer [Mon, 23 Jan 2012 02:53:18 +0000 (18:53 -0800)]
go/doc: add more test cases

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

13 years agogo/doc: set Type.Name field
Robert Griesemer [Mon, 23 Jan 2012 02:52:38 +0000 (18:52 -0800)]
go/doc: set Type.Name field

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

13 years agoencoding/xml: improve []byte handling
Gustavo Niemeyer [Mon, 23 Jan 2012 02:50:05 +0000 (00:50 -0200)]
encoding/xml: improve []byte handling

Marshalling of []byte in attributes and the general
marshalling of named []byte types was fixed.

A []byte field also won't be nil if an XML element
was mapped to it, even if the element is empty.

Tests were introduced to make sure that *struct{}
fields works correctly for element presence testing.
No changes to the logic made in that regard.

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

13 years agodoc/progs: Add the usual Copyright notice.
Olivier Duperray [Mon, 23 Jan 2012 00:19:48 +0000 (11:19 +1100)]
doc/progs: Add the usual Copyright notice.

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

13 years agodoc/codelab/wiki: Add the usual Copyright notice.
Olivier Duperray [Sun, 22 Jan 2012 22:28:32 +0000 (09:28 +1100)]
doc/codelab/wiki: Add the usual Copyright notice.

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

13 years agogo/build: silence all warnings
Andrew Gerrand [Sun, 22 Jan 2012 22:26:46 +0000 (09:26 +1100)]
go/build: silence all warnings

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

13 years agogob: reduce the maximum message size
Rob Pike [Sun, 22 Jan 2012 20:01:12 +0000 (12:01 -0800)]
gob: reduce the maximum message size
It was 2^31, but that could cause overflow and trouble.
Reduce it to 2^30 and add a TODO.

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

13 years agotest: explicitly use variables to avoid gccgo "not used" error
Ian Lance Taylor [Sun, 22 Jan 2012 19:50:45 +0000 (11:50 -0800)]
test: explicitly use variables to avoid gccgo "not used" error

I haven't looked at the source, but the gc compiler appears to
omit "not used" errors when there is an error in the
initializer.  This is harder to do in gccgo, and frankly I
think the "not used" error is still useful even if the
initializer has a problem.  This CL tweaks some tests to avoid
the error, which is not the point of these tests in any case.

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

13 years ago6l, 8l: remove unused macro definition
Shenghou Ma [Sun, 22 Jan 2012 18:35:15 +0000 (10:35 -0800)]
6l, 8l: remove unused macro definition
        Their last use is removed in rev 70ed048caad2.

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

13 years agoruntime: update out-of-date comment
Shenghou Ma [Sun, 22 Jan 2012 18:34:17 +0000 (10:34 -0800)]
runtime: update out-of-date comment

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

13 years agobytes: delete the test for huge buffers
Rob Pike [Sun, 22 Jan 2012 17:25:47 +0000 (09:25 -0800)]
bytes: delete the test for huge buffers
It takes too much memory to be reliable and causes
trouble on 32-bit machines.
Sigh.

Fixes #2756.

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

13 years agobytes.Buffer: remove dead code, complete documentation
Robert Griesemer [Sun, 22 Jan 2012 05:31:21 +0000 (21:31 -0800)]
bytes.Buffer: remove dead code, complete documentation

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

13 years agobytes.Buffer: restore panic on out-of-memory
Rob Pike [Sat, 21 Jan 2012 17:46:59 +0000 (09:46 -0800)]
bytes.Buffer: restore panic on out-of-memory
Make the panic detectable, and use that in ioutil.ReadFile to
give an error if the file is too big.

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

13 years agocompress/flate: fix a typo, improve compression rate by 3-4%.
Ivan Krasin [Sat, 21 Jan 2012 17:18:15 +0000 (12:18 -0500)]
compress/flate: fix a typo, improve compression rate by 3-4%.

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

13 years agonet: Dial, ListenPacket with "ip:protocol" network for raw IP sockets
Mikio Hara [Sat, 21 Jan 2012 12:51:53 +0000 (21:51 +0900)]
net: Dial, ListenPacket with "ip:protocol" network for raw IP sockets

Fixes #2654.

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

13 years agogc: test case for recursive interface bug.
David Symonds [Sat, 21 Jan 2012 06:02:54 +0000 (17:02 +1100)]
gc: test case for recursive interface bug.

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

13 years agocmd/go: every test imports regexp
Russ Cox [Sat, 21 Jan 2012 04:35:28 +0000 (23:35 -0500)]
cmd/go: every test imports regexp

This fixes the bug Rob ran into when editing package bytes.
Regexp imports regexp/syntax, which imports bytes, and
regexp/syntax was not being properly recompiled during a
test of a change to package bytes.

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

13 years agocompress/flate: make lazy matching work.
Ivan Krasin [Sat, 21 Jan 2012 04:35:18 +0000 (23:35 -0500)]
compress/flate: make lazy matching work.

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

13 years agoos: fix Plan 9 build after more FileMode changes
Anthony Martin [Sat, 21 Jan 2012 04:01:29 +0000 (20:01 -0800)]
os: fix Plan 9 build after more FileMode changes

This should go in after Brad's CL 5553064.

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

13 years agobytes: simplified logic
Robert Griesemer [Fri, 20 Jan 2012 23:39:14 +0000 (15:39 -0800)]
bytes: simplified logic

Also: Avoid potential crash due to reslicing of nil buffer.

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

13 years agodoc/go1: flag, runtime, testing
Rob Pike [Fri, 20 Jan 2012 23:38:03 +0000 (15:38 -0800)]
doc/go1: flag, runtime, testing

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

13 years agodoc: fix typo in Go for C++ programmers
Stefan Nilsson [Fri, 20 Jan 2012 22:44:05 +0000 (14:44 -0800)]
doc: fix typo in Go for C++ programmers

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

13 years agodoc/go1: rearrange a bit, sort the packages
Rob Pike [Fri, 20 Jan 2012 22:28:48 +0000 (14:28 -0800)]
doc/go1: rearrange a bit, sort the packages
This should make it easier to add the zillion little changes coming.
No content change here beyond a couple of introductory sentences.
Sections have been moved wholesale without editing them.

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

13 years agogc: undo most of 'fix infinite recursion for embedded interfaces'
Russ Cox [Fri, 20 Jan 2012 22:14:09 +0000 (17:14 -0500)]
gc: undo most of 'fix infinite recursion for embedded interfaces'

Preserve test.

changeset:   11593:f1deaf35e1d1
user:        Luuk van Dijk <lvd@golang.org>
date:        Tue Jan 17 10:00:57 2012 +0100
summary:     gc: fix infinite recursion for embedded interfaces

This is causing 'interface type loop' errors during compilation
of a complex program.  I don't understand what's happening
well enough to boil it down to a simple test case, but undoing
this change fixes the problem.

The change being undone is fixing a corner case (uses of
pointer to interface in an interface definition) that basically
only comes up in erroneous Go programs.  Let's not try to
fix this again until after Go 1.

Unfixes issue 1909.

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

13 years agobytes.Buffer: turn buffer size overflows into errors
Rob Pike [Fri, 20 Jan 2012 21:51:49 +0000 (13:51 -0800)]
bytes.Buffer: turn buffer size overflows into errors
Fixes #2743.

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

13 years agoencoding/varint: deleted WriteXvarint
Robert Griesemer [Fri, 20 Jan 2012 20:57:53 +0000 (12:57 -0800)]
encoding/varint: deleted WriteXvarint

Fixes #2748.

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

13 years agodoc/go1.html: fix broken links
Robert Griesemer [Fri, 20 Jan 2012 20:57:43 +0000 (12:57 -0800)]
doc/go1.html: fix broken links

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

13 years agogo run: correctly handle -n and -x flags
Shenghou Ma [Fri, 20 Jan 2012 20:48:01 +0000 (15:48 -0500)]
go run: correctly handle -n and -x flags

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

13 years agogc: do not try to add a key with incorrect type to a hash
Jeff R. Allen [Fri, 20 Jan 2012 18:34:38 +0000 (13:34 -0500)]
gc: do not try to add a key with incorrect type to a hash

Fixes #2623.

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

13 years agolibmach: cross compiling support
Shenghou Ma [Fri, 20 Jan 2012 18:34:30 +0000 (13:34 -0500)]
libmach: cross compiling support
        We already use GOHOSTOS to represent the host OS that the toolchain
        will be run on, so no need to resort to uname(1) to get that (and
        use uname(1) will make cross-compiling for another host impossible).

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

13 years agoA+C: Berengar Lehr (individual CLA)
Russ Cox [Fri, 20 Jan 2012 18:34:25 +0000 (13:34 -0500)]
A+C: Berengar Lehr (individual CLA)

Was added to CONTRIBUTORS file in:

changeset:   7092:638ad4d7d280
user:        Berengar Lehr <Berengar.Lehr@gmx.de>
date:        Tue Jan 11 20:51:35 2011 -0500
summary:     crypto: add twofish package

but never added to AUTHORS file.

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

13 years agogo/ast: respect ImportSpec.EndPos
Scott Lawrence [Fri, 20 Jan 2012 18:34:19 +0000 (13:34 -0500)]
go/ast: respect ImportSpec.EndPos

Fixes #2566.

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

13 years agogo/doc: avoid the name 'a.out' in the testdata
Russ Cox [Fri, 20 Jan 2012 18:34:11 +0000 (13:34 -0500)]
go/doc: avoid the name 'a.out' in the testdata

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

13 years agogoyacc: fix indexing bug when yydebug >= 2
Rob Pike [Fri, 20 Jan 2012 18:22:41 +0000 (10:22 -0800)]
goyacc: fix indexing bug when yydebug >= 2
Fixes #2701.

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

13 years agomisc/xcode/go.xclangspec: fix typo
Shenghou Ma [Fri, 20 Jan 2012 15:17:52 +0000 (07:17 -0800)]
misc/xcode/go.xclangspec: fix typo

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

13 years agoruntime: add type algorithms for zero-sized types
Dmitriy Vyukov [Fri, 20 Jan 2012 06:32:55 +0000 (10:32 +0400)]
runtime: add type algorithms for zero-sized types
BenchmarkChanSem old=127ns new=78.6ns

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

13 years agotag weekly.2012-01-20
Nigel Tao [Fri, 20 Jan 2012 06:01:55 +0000 (17:01 +1100)]
tag weekly.2012-01-20

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

13 years agoweekly.2012-01-20 weekly.2012-01-20
Nigel Tao [Fri, 20 Jan 2012 05:57:10 +0000 (16:57 +1100)]
weekly.2012-01-20

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

13 years agonet: fix linux build
Mikio Hara [Fri, 20 Jan 2012 02:56:17 +0000 (18:56 -0800)]
net: fix linux build

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