]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
12 years agoweekly.2012-01-27 weekly.2012-01-27
Andrew Gerrand [Fri, 27 Jan 2012 06:51:53 +0000 (17:51 +1100)]
weekly.2012-01-27

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

12 years agogc: remove extra paranoia from inlining unsafe.Pointer fix.
David Symonds [Fri, 27 Jan 2012 02:59:32 +0000 (13:59 +1100)]
gc: remove extra paranoia from inlining unsafe.Pointer fix.

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

12 years agocmd/go: solve ambiguity of get lp.net/project/foo
Gustavo Niemeyer [Fri, 27 Jan 2012 02:58:24 +0000 (00:58 -0200)]
cmd/go: solve ambiguity of get lp.net/project/foo

This solves the ambiguity for "lp.net/project/foo". In these URLs,
"foo" could be a series name registered in Launchpad with its own
branch, and it could also be the name of a directory within the
main project branch one level up.

Solve it by testing if the series branch exists in Launchpad
and if it doesn't moving the root one level up.

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

12 years agogc: permit unsafe.Pointer for inlined functions.
David Symonds [Fri, 27 Jan 2012 02:44:48 +0000 (13:44 +1100)]
gc: permit unsafe.Pointer for inlined functions.

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

12 years agoarchive/zip: add functions to convert between os.FileInfo & FileHeader
Brad Fitzpatrick [Thu, 26 Jan 2012 23:31:09 +0000 (15:31 -0800)]
archive/zip: add functions to convert between os.FileInfo & FileHeader

Fixes #2186

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

12 years ago database/sql: convert SQL null values to []byte as nil.
James P. Cooper [Thu, 26 Jan 2012 23:12:48 +0000 (15:12 -0800)]
database/sql: convert SQL null values to []byte as nil.

Also allow string values to scan into []byte.
Fixes #2788.

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

12 years agoFAQ: more words about why GOMAXPROCS>1 might not speed you up
Rob Pike [Thu, 26 Jan 2012 22:44:38 +0000 (14:44 -0800)]
FAQ: more words about why GOMAXPROCS>1 might not speed you up

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

12 years agonet/http: add Request.RequestURI field
Brad Fitzpatrick [Thu, 26 Jan 2012 22:37:14 +0000 (14:37 -0800)]
net/http: add Request.RequestURI field

The new url.URL's parsing can be too canonicalizing for
certain applications. By keeping the original request URI
around, we give applications a gross escape hatch while
keeping the URL package clean and simple for normal uses.

(From a discussion with Gary Burd, Gustavo Niemeyer,
and Russ Cox.)

Fixes #2782

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

12 years agogc, runtime: handle floating point map keys
Russ Cox [Thu, 26 Jan 2012 21:25:07 +0000 (16:25 -0500)]
gc, runtime: handle floating point map keys

Fixes #2609.

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

12 years ago6c, 8c: make floating point code NaN-safe
Russ Cox [Thu, 26 Jan 2012 21:23:29 +0000 (16:23 -0500)]
6c, 8c: make floating point code NaN-safe

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

12 years agocmd/go: update doc.go with text generated from the usage strings
Andrew Gerrand [Thu, 26 Jan 2012 21:19:43 +0000 (08:19 +1100)]
cmd/go: update doc.go with text generated from the usage strings

Fixes #2783.

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

12 years agomath/big: test both bitLen and bitLen_g
Robert Griesemer [Thu, 26 Jan 2012 18:08:21 +0000 (10:08 -0800)]
math/big: test both bitLen and bitLen_g

Also: simpler, more direct test.

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

12 years agogodoc: move overview before API TOC
Russ Cox [Thu, 26 Jan 2012 18:02:03 +0000 (13:02 -0500)]
godoc: move overview before API TOC

Compare:
http://swtch.com/junk/regexp0.html [old]
http://swtch.com/junk/regexp.html [new]

Especially for packages with large APIs, this makes the
overview more promiment, so that it can give the appropriate
context for reading the API list.  This should help significantly
in packages with large APIs, like net, so that the first thing users
see is not a jumble of functions but an introduction to the package.

R=adg, gri, r, kevlar, dsymonds, rogpeppe
CC=golang-dev
https://golang.org/cl/5573068

12 years agonet/http: make ParseForm ignore unknown content types.
Roger Peppe [Thu, 26 Jan 2012 16:50:56 +0000 (16:50 +0000)]
net/http: make ParseForm ignore unknown content types.
Also fix a shadowed error variable bug.

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

12 years agonet: make WriteTo fail when UDPConn is already connected
Mikio Hara [Thu, 26 Jan 2012 16:31:42 +0000 (01:31 +0900)]
net: make WriteTo fail when UDPConn is already connected

Fixes #2773.

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

12 years agogc: softer criteria for inlinability.
Luuk van Dijk [Thu, 26 Jan 2012 16:20:48 +0000 (17:20 +0100)]
gc: softer criteria for inlinability.

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

12 years agonet/rpc: log Call reply discard
Dmitriy Vyukov [Thu, 26 Jan 2012 16:09:09 +0000 (20:09 +0400)]
net/rpc: log Call reply discard
It means serious user error that can lead to
hard to debug issues under load, log entry
will not harm.

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

12 years agonet/rpc: fix data race in benchmark
Dmitriy Vyukov [Thu, 26 Jan 2012 16:06:27 +0000 (20:06 +0400)]
net/rpc: fix data race in benchmark
Fixes #2781.

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

12 years agocmd/gc: forgotten recursion on ninit itself in order.c
Luuk van Dijk [Thu, 26 Jan 2012 14:10:24 +0000 (15:10 +0100)]
cmd/gc: forgotten recursion on ninit itself in order.c

Fixes test/reorder2.go for all cases tripped up with -lll in 5555072

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

12 years agonet/rpc: fix race in TestClientWriteError test
Dmitriy Vyukov [Thu, 26 Jan 2012 07:37:07 +0000 (11:37 +0400)]
net/rpc: fix race in TestClientWriteError test
Fixes #2752.

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

12 years agodoc/go1: minor html fixes
Robert Hencke [Thu, 26 Jan 2012 05:09:46 +0000 (21:09 -0800)]
doc/go1: minor html fixes

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

12 years agopath/filepath: fix test
Rob Pike [Thu, 26 Jan 2012 04:19:55 +0000 (20:19 -0800)]
path/filepath: fix test
If there's an error, sometimes you need to stop.
Part of issue 2787.

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

12 years agodoc/go1: add encoding/xml changes
Gustavo Niemeyer [Thu, 26 Jan 2012 02:59:50 +0000 (00:59 -0200)]
doc/go1: add encoding/xml changes

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

12 years agodatabase/sql: fix Tx.Query
Blake Mizerany [Thu, 26 Jan 2012 01:49:30 +0000 (17:49 -0800)]
database/sql: fix Tx.Query

Fixes #2784

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

12 years agocmd/goapi: new tool for tracking exported API over time
Brad Fitzpatrick [Thu, 26 Jan 2012 01:47:57 +0000 (17:47 -0800)]
cmd/goapi: new tool for tracking exported API over time

The idea is that we add files to the api/ directory which
are sets of promises for the future.  Each line in a file
is a stand-alone feature description.

When we do a release, we make sure we haven't broken or changed
any lines from the past (only added them).

We never change old files, only adding new ones. (go-1.1.txt,
etc)

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

12 years agodatabase/sql: add NullInt64, NullFloat64, NullBool
James P. Cooper [Thu, 26 Jan 2012 01:47:32 +0000 (17:47 -0800)]
database/sql: add NullInt64, NullFloat64, NullBool

Fixes #2699

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

12 years agodoc/go1: fix urls
Gustavo Niemeyer [Thu, 26 Jan 2012 01:42:36 +0000 (23:42 -0200)]
doc/go1: fix urls

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

12 years agoA+C: Add James P. Cooper (Individual CLA)
Brad Fitzpatrick [Thu, 26 Jan 2012 01:34:02 +0000 (17:34 -0800)]
A+C: Add James P. Cooper (Individual CLA)

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

12 years agoA+C: add Blake Mizerany (Individual CLA)
Brad Fitzpatrick [Thu, 26 Jan 2012 01:24:08 +0000 (17:24 -0800)]
A+C: add Blake Mizerany (Individual CLA)

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

12 years agodoc/go1: add net/url changes
Gustavo Niemeyer [Thu, 26 Jan 2012 01:11:25 +0000 (23:11 -0200)]
doc/go1: add net/url changes

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

12 years agogo/doc: fix typo
Robert Griesemer [Thu, 26 Jan 2012 01:09:50 +0000 (17:09 -0800)]
go/doc: fix typo

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

12 years agogo/doc: revert API change (per former discussion) and cleanup
Robert Griesemer [Thu, 26 Jan 2012 00:48:06 +0000 (16:48 -0800)]
go/doc: revert API change (per former discussion) and cleanup

Separating Method from Func made the code only more complicated
without adding much to the useability/readability of the API.
Reverted to where it was, but leaving the new method-specific
fields Orig and Level.

Former clients (godoc) of doc.Method only used the Func fields;
and because Func was embedded, no changes are needed with respect
to the removal of Method.

Changed type of Func.Recv from ast.Expr to string. This was a
long-standing TODO. Also implemented Func.Orig field (another TODO).

No further go/doc API changes are expected for Go 1.

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

12 years agomath/big: return type of bitLen is an int; use MOVL on amd64.
David G. Andersen [Thu, 26 Jan 2012 00:09:12 +0000 (16:09 -0800)]
math/big:  return type of bitLen is an int;  use MOVL on amd64.

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

12 years agogofix: handle xml.Unmarshal in xmlapi fix
Gustavo Niemeyer [Wed, 25 Jan 2012 23:07:00 +0000 (21:07 -0200)]
gofix: handle xml.Unmarshal in xmlapi fix

This improves the handling of xml.Unmarshal in
the xmlapi fix by guessing some of the common
types used on it.

This also fixes a bug in the partial typechecker.
In an expression such as f(&a), it'd mark a as
having &T rather than *T.

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

12 years agomath/big: assembly versions of bitLen for x86-64, 386, and ARM.
David G. Andersen [Wed, 25 Jan 2012 23:04:16 +0000 (15:04 -0800)]
math/big:  assembly versions of bitLen for x86-64, 386, and ARM.

Roughly 2x speedup for the internal bitLen function in arith.go.  Added TestWordBitLen test.

Performance differences against the new version of
bitLen generic:

x86-64 Macbook pro (current tip):

benchmark                old ns/op    new ns/op    delta
big.BenchmarkBitLen0             6            4  -37.40%
big.BenchmarkBitLen1             6            2  -51.79%
big.BenchmarkBitLen2             6            2  -65.04%
big.BenchmarkBitLen3             6            2  -66.10%
big.BenchmarkBitLen4             6            2  -60.96%
big.BenchmarkBitLen5             6            2  -55.80%
big.BenchmarkBitLen8             6            2  -56.19%
big.BenchmarkBitLen9             6            2  -64.73%
big.BenchmarkBitLen16            7            2  -68.84%
big.BenchmarkBitLen17            6            2  -67.11%
big.BenchmarkBitLen31            7            2  -61.57%

386 Intel Atom (current tip):
benchmark                old ns/op    new ns/op    delta
big.BenchmarkBitLen0            23           20  -13.04%
big.BenchmarkBitLen1            23           20  -14.77%
big.BenchmarkBitLen2            24           20  -19.28%
big.BenchmarkBitLen3            25           20  -21.57%
big.BenchmarkBitLen4            24           20  -16.94%
big.BenchmarkBitLen5            25           20  -20.78%
big.BenchmarkBitLen8            24           20  -19.28%
big.BenchmarkBitLen9            25           20  -20.47%
big.BenchmarkBitLen16           26           20  -23.37%
big.BenchmarkBitLen17           26           20  -25.09%
big.BenchmarkBitLen31           32           20  -35.51%

ARM v5 SheevaPlug, previous weekly patched with bitLen:
benchmark                old ns/op    new ns/op    delta
big.BenchmarkBitLen0            50           29  -41.73%
big.BenchmarkBitLen1            51           29  -42.75%
big.BenchmarkBitLen2            59           29  -50.08%
big.BenchmarkBitLen3            60           29  -50.75%
big.BenchmarkBitLen4            59           29  -50.08%
big.BenchmarkBitLen5            60           29  -50.75%
big.BenchmarkBitLen8            59           29  -50.08%
big.BenchmarkBitLen9            60           29  -50.75%
big.BenchmarkBitLen16           69           29  -57.35%
big.BenchmarkBitLen17           70           29  -57.89%
big.BenchmarkBitLen31           95           29  -69.07%

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

12 years agonet/http: fix Transport deadlock
Yoshiyuki Kanno [Wed, 25 Jan 2012 23:00:39 +0000 (15:00 -0800)]
net/http: fix Transport deadlock

This patch intend to fix following issues.
http://code.google.com/p/go/issues/detail?id=2616

Fixes #2616.

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

12 years agogc: fix order of evaluation
Russ Cox [Wed, 25 Jan 2012 22:53:50 +0000 (17:53 -0500)]
gc: fix order of evaluation

Pulling function calls out to happen before the
expression being evaluated was causing illegal
reorderings even without inlining; with inlining
it got worse.  This CL adds a separate ordering pass
to move things with a fixed order out of expressions
and into the statement sequence, where they will
not be reordered by walk.

Replaces lvd's CL 5534079.

Fixes #2740.

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

12 years agoregexp: remove vestigial Error type
Brad Fitzpatrick [Wed, 25 Jan 2012 22:50:37 +0000 (14:50 -0800)]
regexp: remove vestigial Error type

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

12 years agonet: fix dialing google test
Mikio Hara [Wed, 25 Jan 2012 22:38:49 +0000 (07:38 +0900)]
net: fix dialing google test

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

12 years agogo/doc: test cases for sort order
Robert Griesemer [Wed, 25 Jan 2012 21:56:12 +0000 (13:56 -0800)]
go/doc: test cases for sort order

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

12 years agogo1: sub-repositories
Rob Pike [Wed, 25 Jan 2012 21:29:25 +0000 (13:29 -0800)]
go1: sub-repositories

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

12 years agosyscall: add NOTE_* constants on OS X
Robert Figueiredo [Wed, 25 Jan 2012 20:50:23 +0000 (15:50 -0500)]
syscall: add NOTE_* constants on OS X

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

12 years agoA+C: Robert Figueiredo (individual CLA)
Russ Cox [Wed, 25 Jan 2012 20:50:19 +0000 (15:50 -0500)]
A+C: Robert Figueiredo (individual CLA)

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

12 years agobuild: fix build
Russ Cox [Wed, 25 Jan 2012 20:41:49 +0000 (15:41 -0500)]
build: fix build

I said rm, but not hg rm.
I never was good at Simon says.

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

12 years agonet/http: disabled test for Transport race / deadlock bug
Brad Fitzpatrick [Wed, 25 Jan 2012 20:31:06 +0000 (12:31 -0800)]
net/http: disabled test for Transport race / deadlock bug

The real fix for Issue 2616 is in
https://golang.org/cl/5532057, to be submitted
following this CL, without the test there which doesn't work
reliably. This one seems to.

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

12 years agobuild: remove code now in subrepositories
Russ Cox [Wed, 25 Jan 2012 20:30:42 +0000 (15:30 -0500)]
build: remove code now in subrepositories

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

12 years agogofix: update go1pkgrename for subrepositories
Russ Cox [Wed, 25 Jan 2012 20:30:03 +0000 (15:30 -0500)]
gofix: update go1pkgrename for subrepositories

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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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