]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agoencoding/json: document angle bracket escaping.
David Symonds [Wed, 18 Jan 2012 01:56:24 +0000 (12:56 +1100)]
encoding/json: document angle bracket escaping.

Fixes #2643.

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

13 years agoimage: fix typo in Rectangle.Sub comment.
Nigel Tao [Tue, 17 Jan 2012 23:55:03 +0000 (10:55 +1100)]
image: fix typo in Rectangle.Sub comment.

Fixes #2724.

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

13 years agofmt: fix Malloc test
Rob Pike [Tue, 17 Jan 2012 23:42:02 +0000 (15:42 -0800)]
fmt: fix Malloc test
We need to avoid allocating an extra word for the interface value
passing the floating-point value as an interface{}. It's easy.

Fixes #2722.

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

13 years agoutf8.String: move to exp/utf8string.String
Rob Pike [Tue, 17 Jan 2012 22:21:50 +0000 (14:21 -0800)]
utf8.String: move to exp/utf8string.String

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

13 years agotesting: document examples
Rob Pike [Tue, 17 Jan 2012 22:20:27 +0000 (14:20 -0800)]
testing: document examples
The package documentation did not mention them.
They were described only in godoc for gotest, and that's going away.

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

13 years agonet/http: change test to use override param instead of chan.
David Symonds [Tue, 17 Jan 2012 21:28:09 +0000 (08:28 +1100)]
net/http: change test to use override param instead of chan.

Follow-on from https://golang.org/cl/5543062.

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

13 years agotext/template: fix nil error on redefinition
Rob Pike [Tue, 17 Jan 2012 21:24:59 +0000 (13:24 -0800)]
text/template: fix nil error on redefinition
Fixes #2720.

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

13 years agonet/http/cgi: increase a flaky test timeout
Brad Fitzpatrick [Tue, 17 Jan 2012 21:14:27 +0000 (13:14 -0800)]
net/http/cgi: increase a flaky test timeout

Fixes 2450, probably.

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

13 years agocmd/go: remove mentions of 'gotest' from the documentation
Rob Pike [Tue, 17 Jan 2012 21:13:50 +0000 (13:13 -0800)]
cmd/go: remove mentions of 'gotest' from the documentation
go test runs the tests itself; it does not run the gotest command,
so these mentions are confusing.

R=golang-dev, n13m3y3r
CC=golang-dev
https://golang.org/cl/5551043

13 years agocontainer/heap: better package documentation
Rob Pike [Tue, 17 Jan 2012 21:07:47 +0000 (13:07 -0800)]
container/heap: better package documentation
Fixes #1820.

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

13 years agomime: make FormatMediaType take full type for consistency
Brad Fitzpatrick [Tue, 17 Jan 2012 19:57:42 +0000 (11:57 -0800)]
mime: make FormatMediaType take full type for consistency

Fixes #2405

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

13 years agofmt: enable and fix malloc test
Rob Pike [Tue, 17 Jan 2012 18:45:36 +0000 (10:45 -0800)]
fmt: enable and fix malloc test
On 32-bit machines, %g takes an extra malloc. I don't know why yet,
but this makes the test pass again, and enables it even for -short.

Fixes #2653.

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

13 years agoexp/sql: copy when scanning into []byte by default
Brad Fitzpatrick [Tue, 17 Jan 2012 18:44:35 +0000 (10:44 -0800)]
exp/sql: copy when scanning into []byte by default

Fixes #2698

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

13 years agodoc/docs: fix broken links
Scott Lawrence [Tue, 17 Jan 2012 18:29:08 +0000 (10:29 -0800)]
doc/docs: fix broken links

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

13 years agodoc: I have modified the broken links.
Jongmin Kim [Tue, 17 Jan 2012 17:47:34 +0000 (09:47 -0800)]
doc: I have modified the broken links.

R=golang-dev, duperray.olivier, r
CC=adg, golang-dev
https://golang.org/cl/5542054

13 years agobuildscripts: move to buildscript directory
Shenghou Ma [Tue, 17 Jan 2012 16:18:15 +0000 (11:18 -0500)]
buildscripts: move to buildscript directory
        Fixes #2717.

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

13 years agogc: give esc.c's sink an orig so -mm diagnostics work again.
Luuk van Dijk [Tue, 17 Jan 2012 09:01:12 +0000 (10:01 +0100)]
gc: give esc.c's sink an orig so -mm diagnostics work again.

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

13 years agogc: fix infinite recursion for embedded interfaces
Luuk van Dijk [Tue, 17 Jan 2012 09:00:57 +0000 (10:00 +0100)]
gc: fix infinite recursion for embedded interfaces

Fixes #1909

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

13 years agoold/netchan: fix data race on client hashmap
Dmitriy Vyukov [Tue, 17 Jan 2012 07:48:20 +0000 (11:48 +0400)]
old/netchan: fix data race on client hashmap
Fixes #2713.

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

13 years agopkg: add missing godoc comments to windows versions
Alex Brainman [Tue, 17 Jan 2012 05:51:54 +0000 (16:51 +1100)]
pkg: add missing godoc comments to windows versions

Mostly copied comments from unix files.

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

13 years agogo/build: no back slash in FindTree returned pkg name
Alex Brainman [Tue, 17 Jan 2012 05:51:02 +0000 (16:51 +1100)]
go/build: no back slash in FindTree returned pkg name

Fixes #2652.

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

13 years agoexp/proxy: fix build after URL changes
Gustavo Niemeyer [Tue, 17 Jan 2012 02:55:35 +0000 (00:55 -0200)]
exp/proxy: fix build after URL changes

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

13 years agonet/url: cleaned up URL interface (v2)
Gustavo Niemeyer [Tue, 17 Jan 2012 02:49:05 +0000 (00:49 -0200)]
net/url: cleaned up URL interface (v2)

Duplicated fields from URL were dropped so that its behavior
is simple and expected when being stringified and when being
operated by packages like http. Most of the preserved fields
are in unencoded form, except for RawQuery which continues to
exist and be more easily handled via url.Query().

The RawUserinfo field was also replaced since it wasn't practical
to use and had limitations when operating with empty usernames
and passwords which are allowed by the RFC. In its place the
Userinfo type was introduced and made accessible through the
url.User and url.UserPassword functions.

What was previous built as:

        url.URL{RawUserinfo: url.EncodeUserinfo("user", ""), ...}

Is now built as:

        url.URL{User: url.User("user"), ...}

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

13 years agonet: fix unintentional error variable shadowing
Mikio Hara [Tue, 17 Jan 2012 01:59:39 +0000 (10:59 +0900)]
net: fix unintentional error variable shadowing

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

13 years ago5l: remove redundant code
Shenghou Ma [Tue, 17 Jan 2012 00:29:54 +0000 (19:29 -0500)]
5l: remove redundant code
        5l/asm.c: code in line 311-319 has already outputed segtext.sect->next;

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

13 years agomath/rand: document default initial seed for global generator
Scott Lawrence [Mon, 16 Jan 2012 23:13:34 +0000 (18:13 -0500)]
math/rand: document default initial seed for global generator

Fixes #2044.

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

13 years agogc: don't fault on return outside function
Scott Lawrence [Mon, 16 Jan 2012 23:12:25 +0000 (18:12 -0500)]
gc: don't fault on return outside function

Fixes #2598.

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

13 years agoexp/terminal: fix build on non-Linux using Makefiles
Russ Cox [Mon, 16 Jan 2012 22:49:58 +0000 (17:49 -0500)]
exp/terminal: fix build on non-Linux using Makefiles

The Makefiles will go away soon.

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

13 years agodoc: fix anchor tag for latest weekly.
David Symonds [Mon, 16 Jan 2012 22:04:51 +0000 (09:04 +1100)]
doc: fix anchor tag for latest weekly.

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

13 years agonet/http: send cookies in jar on redirect
Jeff Hodges [Mon, 16 Jan 2012 20:57:59 +0000 (12:57 -0800)]
net/http: send cookies in jar on redirect

Until a RFC 6265 jar lands, Request.AddCookie() will work incorrectly.

Fixes #2692

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

13 years agoruntime: implement runtime.usleep for FreeBSD/386 and amd64.
Shenghou Ma [Mon, 16 Jan 2012 16:22:34 +0000 (03:22 +1100)]
runtime: implement runtime.usleep for FreeBSD/386 and amd64.

R=golang-dev, jsing
CC=golang-dev
https://golang.org/cl/5528106

13 years agoexp/ssh: rename (some) fields
Christopher Wedgwood [Mon, 16 Jan 2012 15:09:36 +0000 (10:09 -0500)]
exp/ssh: rename (some) fields

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

13 years agoruntime: fix typo in comment
Maxim Pimenov [Mon, 16 Jan 2012 14:42:18 +0000 (18:42 +0400)]
runtime: fix typo in comment

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

13 years agonet/http: fix data race in test
Dmitriy Vyukov [Mon, 16 Jan 2012 10:47:33 +0000 (14:47 +0400)]
net/http: fix data race in test
Fixes #2712.

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

13 years agosync/atomic: fix data race in tests
Dmitriy Vyukov [Mon, 16 Jan 2012 07:43:36 +0000 (11:43 +0400)]
sync/atomic: fix data race in tests
Fixes #2710.

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

13 years agoexp/inotify: fix data race in linux tests
Dmitriy Vyukov [Mon, 16 Jan 2012 07:11:58 +0000 (11:11 +0400)]
exp/inotify: fix data race in linux tests
Fixes #2708.

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

13 years agonet: consistent log format in test
Mikio Hara [Mon, 16 Jan 2012 05:57:18 +0000 (14:57 +0900)]
net: consistent log format in test

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

13 years agoimage/color: simplify documentation
David Crawshaw [Mon, 16 Jan 2012 05:02:31 +0000 (16:02 +1100)]
image/color: simplify documentation

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

13 years agoexp/ssh: add marshal functions for uint32 and uint64 types
Jonathan Pittman [Mon, 16 Jan 2012 00:54:17 +0000 (19:54 -0500)]
exp/ssh: add marshal functions for uint32 and uint64 types

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

13 years agoCONTRIBUTORS: add Johnathan Pittman
Adam Langley [Mon, 16 Jan 2012 00:52:45 +0000 (19:52 -0500)]
CONTRIBUTORS: add Johnathan Pittman

(Google CLA)

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

13 years agotag weekly.2012-01-15
Andrew Gerrand [Sun, 15 Jan 2012 22:52:35 +0000 (09:52 +1100)]
tag weekly.2012-01-15

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

13 years agoweekly.2012-01-15 weekly.2012-01-15
Andrew Gerrand [Sun, 15 Jan 2012 22:45:20 +0000 (09:45 +1100)]
weekly.2012-01-15

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

13 years agoexp/terminal: still trying to unbreak non-Linux builds.
Adam Langley [Sun, 15 Jan 2012 15:41:16 +0000 (10:41 -0500)]
exp/terminal: still trying to unbreak non-Linux builds.

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

13 years agoexp/terminal: add to level Makefile for the (non-Linux?) systems that need it.
Adam Langley [Sun, 15 Jan 2012 15:22:15 +0000 (10:22 -0500)]
exp/terminal: add to level Makefile for the (non-Linux?) systems that need it.

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

13 years agoexp/ssh: patching in the last change lost that a file was deleted.
Adam Langley [Sun, 15 Jan 2012 15:08:48 +0000 (10:08 -0500)]
exp/ssh: patching in the last change lost that a file was deleted.

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

13 years agoexp/ssh: remove duplicated terminal code.
Adam Langley [Sun, 15 Jan 2012 14:59:06 +0000 (09:59 -0500)]
exp/ssh: remove duplicated terminal code.

The terminal code in exp/terminal was forked from the code in exp/ssh.
This change removes the duplicated code from exp/ssh in favour of
using exp/terminal.

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

13 years agohttp: Allow cookies with negative Max-Age attribute as these are
Volker Dobler [Sun, 15 Jan 2012 08:32:16 +0000 (19:32 +1100)]
http: Allow cookies with negative Max-Age attribute as these are
allowed by RFC 6265 sec 5.2.2.

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

13 years agonet: platform-dependent default socket options
Mikio Hara [Sun, 15 Jan 2012 05:19:44 +0000 (14:19 +0900)]
net: platform-dependent default socket options

This CL revises existing platform-dependent default socket
options to make it possible to accomodate multiple multicast
datagram listeners on a single service port.

Also removes unnecessary SO_REUSEADDR, SO_REUSEPORT socket
options from unicast datagram sockets by default.

Fixes #1692.

R=devon.odell, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5538052

13 years agogo/doc: print only one newline between paragraphs
Rob Pike [Sat, 14 Jan 2012 19:57:32 +0000 (11:57 -0800)]
go/doc: print only one newline between paragraphs
Fixes #2595.

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

13 years agodoc: fix comments referring to removed API funcs
Shenghou Ma [Sat, 14 Jan 2012 18:59:45 +0000 (10:59 -0800)]
doc: fix comments referring to removed API funcs
        The strconv package has removed Atob, AtoF{64,32} and Ftoa.

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

13 years agogc: do not compile switch on interface values into a binary search.
Rémy Oudompheng [Sat, 14 Jan 2012 16:00:14 +0000 (17:00 +0100)]
gc: do not compile switch on interface values into a binary search.

Fixes #2672.

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

13 years agoexp/terminal: add SetPrompt and handle large pastes.
Adam Langley [Sat, 14 Jan 2012 15:59:11 +0000 (10:59 -0500)]
exp/terminal: add SetPrompt and handle large pastes.

(This was missing in the last change because I uploaded it from the
wrong machine.)

Large pastes previously misbehaved because the code tried reading from
the terminal before checking whether an line was already buffered.
Large pastes can cause multiples lines to be read at once from the
terminal.

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

13 years agoexp/proxy: new package
Adam Langley [Sat, 14 Jan 2012 15:44:35 +0000 (10:44 -0500)]
exp/proxy: new package

exp/proxy provides client support for tunneling connections through
various proxies.

This is an initial, incomplete sketch of the code to lay down an
API.

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

13 years agonet: make use of the kernel state to listen on TCP, Unix
Mikio Hara [Sat, 14 Jan 2012 04:42:18 +0000 (13:42 +0900)]
net: make use of the kernel state to listen on TCP, Unix

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

13 years agocmd/gofmt: fix simplify.go by running gofmt on cmd/gofmt
Olivier Duperray [Sat, 14 Jan 2012 02:05:47 +0000 (18:05 -0800)]
cmd/gofmt: fix simplify.go by running gofmt on cmd/gofmt

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

13 years agogo/doc: remove duplicate package comment
Scott Lawrence [Sat, 14 Jan 2012 00:49:30 +0000 (16:49 -0800)]
go/doc: remove duplicate package comment

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

13 years agopkg/go/doc: fix undefined: doc.NewPackageDoc in headscan.go
Olivier Duperray [Sat, 14 Jan 2012 00:45:30 +0000 (16:45 -0800)]
pkg/go/doc: fix undefined: doc.NewPackageDoc in headscan.go

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

13 years agoexp/sql: add time.Time support
Brad Fitzpatrick [Fri, 13 Jan 2012 23:45:05 +0000 (15:45 -0800)]
exp/sql: add time.Time support

Fixes #2694

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

13 years agogo/ast: fix typo
Scott Lawrence [Fri, 13 Jan 2012 23:36:54 +0000 (15:36 -0800)]
go/ast: fix typo

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

13 years agoexp/sql: fix statement leak
Brad Fitzpatrick [Fri, 13 Jan 2012 23:25:07 +0000 (15:25 -0800)]
exp/sql: fix statement leak

Also verified in external test suite that this fixes MySQL
resource exhaustion problems, and also exposed a double-free
bug in the gosqlite3 driver (where gosqlite3 either got lucky
before, or was working around this bug)

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

13 years agostrconv: faster FormatFloat(x, *, -1, 64) using Grisu3 algorithm.
Rémy Oudompheng [Fri, 13 Jan 2012 22:24:33 +0000 (23:24 +0100)]
strconv: faster FormatFloat(x, *, -1, 64) using Grisu3 algorithm.

The implementation is similar to the one from the double-conversion
library used in the Chrome V8 engine.

                            old ns/op   new ns/op  speedup
BenchmarkAppendFloatDecimal      591         480      1.2x
BenchmarkAppendFloat            2956         486      6.1x
BenchmarkAppendFloatExp        10622         503     21.1x
BenchmarkAppendFloatNegExp     40343         483     83.5x
BenchmarkAppendFloatBig         2798         664      4.2x

See F. Loitsch, ``Printing Floating-Point Numbers Quickly and
Accurately with Integers'', Proceedings of the ACM, 2010.

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

13 years agotemplate: for range on a map, sort the keys if feasible.
Rob Pike [Fri, 13 Jan 2012 22:09:13 +0000 (14:09 -0800)]
template: for range on a map, sort the keys if feasible.
Fixes #2696.

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

13 years agosrc: make use of runtime.GOOS, GOARCH instead of syscall.OS, ARCH
Mikio Hara [Fri, 13 Jan 2012 21:40:55 +0000 (06:40 +0900)]
src: make use of runtime.GOOS, GOARCH instead of syscall.OS, ARCH

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

13 years agospec: change the wording regarding select statement choice
Rob Pike [Fri, 13 Jan 2012 21:38:36 +0000 (13:38 -0800)]
spec: change the wording regarding select statement choice
s/pseudo-random fair/uniform pseudo-random/
This careful word choice soothes the theoretically inclined.

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

13 years agobytes: make Write and WriteString code look the same
Brad Fitzpatrick [Fri, 13 Jan 2012 19:48:57 +0000 (11:48 -0800)]
bytes: make Write and WriteString code look the same

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

13 years agotime: delete unused buffer.WriteByte method
Rob Pike [Fri, 13 Jan 2012 19:47:55 +0000 (11:47 -0800)]
time: delete unused buffer.WriteByte method

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

13 years agocmd/go: fix data race during build
Dmitriy Vyukov [Fri, 13 Jan 2012 18:22:03 +0000 (22:22 +0400)]
cmd/go: fix data race during build
Fixes #2695.

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

13 years agogodoc: make ?m=src mode deterministic
Robert Griesemer [Fri, 13 Jan 2012 17:32:35 +0000 (09:32 -0800)]
godoc: make ?m=src mode deterministic

Merge package files in the go/ast MergePackageFiles
function always     in the same order (sorted by filename)
instead  of map iteration order to obtain the same
package  file each time.  This functionality is used
by godoc when displaying packages in ?m=src mode.

Also: minor cleanup in godoc.go.

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

13 years agoxml: major Go 1 fixup
Gustavo Niemeyer [Fri, 13 Jan 2012 10:05:19 +0000 (11:05 +0100)]
xml: major Go 1 fixup

This CL improves the xml package in the following ways:

- makes its interface match established conventions
- brings Marshal and Unmarshal closer together
- fixes a large number of bugs and adds tests
- improves speed significantly
- organizes and simplifies the code

Fixes #2426.
Fixes #2406.
Fixes #1989.

What follows is a detailed list of those changes.

- All matching is case sensitive without special processing
  to the field name or xml tag in an attempt to match them.
  Customize the field tag as desired to match the correct XML
  elements.

- Flags are ",flag" rather than "flag". The names "attr",
  "chardata", etc, may be used to name actual XML elements.

- Overriding of attribute names is possible with "name,attr".

- Attribute fields are marshalled properly if they have
  non-string types. Previously they were unmarshalled, but were
  ignored at marshalling time.

- Comment fields tagged with ",comment" are marshalled properly,
  rather than being marshalled as normal fields.

- The handling of the Any field has been replaced by the ",any"
  flag to avoid unexpected results when using the field name for
  other purposes, and has also been fixed to interact properly
  with name paths. Previously the feature would not function
  if any field in the type had a name path in its tag.

- Embedded struct support fixed and cleaned so it works when
  marshalling and also when using field paths deeper than one level.

- Conflict reporting on field names have been expanded to cover
  all fields. Previously it'd catch only conflicts of paths
  deeper than one level. Also interacts correctly with embedded
  structs now.

- A trailing '>' is disallowed in xml tags. It used to be
  supported for removing the ambiguity between "attr" and "attr>",
  but the marshalling support for that was broken, and it's now
  unnecessary. Use "name" instead of "name>".

- Fixed docs to point out that a XMLName doesn't have to be
  an xml.Name (e.g. a struct{} is a good fit too). The code was
  already working like that.

- Fixed asymmetry in the precedence of XML element names between
  marshalling and unmarshalling. Marshal would consider the XMLName
  of the field type before the field tag, while unmarshalling would
  do the opposite. Now both respect the tag of the XMLName field
  first, and a nice error message is provided in case an attempt
  is made to name a field with its tag in a way that would
  conflict with the underlying type's XMLName field.

- Do not marshal broken "<???>" tags when in doubt. Use the type
  name, and error out if that's not possible.

- Do not break down unmarshalling if there's an interface{} field
  in a struct.

- Significant speed boost due to caching of type metadata and
  overall allocation clean ups. The following timings reflect
  processing of the the atom test data:

  Old:

  BenchmarkMarshal           50000             48798 ns/op
  BenchmarkUnmarshal          5000            357174 ns/op

  New:

  BenchmarkMarshal          100000             19799 ns/op
  BenchmarkUnmarshal         10000            128525 ns/op

R=cw, gustavo, kevlar, adg, rogpeppe, fullung, christoph, rsc
CC=golang-dev
https://golang.org/cl/5503078

13 years agogodoc: fix missing name change
Robert Griesemer [Fri, 13 Jan 2012 01:54:17 +0000 (17:54 -0800)]
godoc: fix missing name change

Fixes godoc text mode (i.e., URL?m=text).

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

13 years agogo/doc: streamlined go/doc API
Robert Griesemer [Fri, 13 Jan 2012 01:36:57 +0000 (17:36 -0800)]
go/doc: streamlined go/doc API

- the main changes are removing the Doc suffix
  from the exported types, so instead of
  doc.TypeDoc one will have doc.Type, etc.

- All exported types now have a Name (or Names) field.
  For Values, the Names field lists all declared variables
  or constants.

- Methods have additional information about where they are
  coming from.

- There's a mode field instead of a bool to
  control the package's operation, which makes
  it easier to extend w/o API changes.

Except for the partially implemented new Method type,
this is based on existing code. A clean rewrite is in
progress based on this new API.

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

13 years agogo/doc: initial testing support
Robert Griesemer [Fri, 13 Jan 2012 01:20:51 +0000 (17:20 -0800)]
go/doc: initial testing support

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

13 years agogo/doc: don't ignore anonymous non-exported fields
Robert Griesemer [Fri, 13 Jan 2012 00:05:05 +0000 (16:05 -0800)]
go/doc: don't ignore anonymous non-exported fields

- remove wrapper.go from testing package (not needed anymore)

Fixes #1000.

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

13 years agogo/parser: Remove unused Parse* functions. Simplified ParseExpr signature.
Robert Griesemer [Fri, 13 Jan 2012 00:04:48 +0000 (16:04 -0800)]
go/parser: Remove unused Parse* functions. Simplified ParseExpr signature.

Only ParseFile, ParseDir, and ParseExpr are used in the tree.
If partial parsing of code is required, it is fairly simple
to wrap the relevant piece of code into a dummy package for
parsing (see parser.ParseExpr).

Also: minor cleanups.

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

13 years agogo/ast: remove unnecessary result value from ast.Fprint/Print
Robert Griesemer [Fri, 13 Jan 2012 00:04:32 +0000 (16:04 -0800)]
go/ast: remove unnecessary result value from ast.Fprint/Print

These functions are mostly of interest for debugging; the
number of bytes written is uninteresting.

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

13 years agocmd/go: use relative paths in go fix, go fmt, go vet output
Russ Cox [Thu, 12 Jan 2012 23:28:52 +0000 (15:28 -0800)]
cmd/go: use relative paths in go fix, go fmt, go vet output

Fixes #2686.

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

13 years agocmd/go: handle path to cmd directory
Russ Cox [Thu, 12 Jan 2012 23:27:57 +0000 (15:27 -0800)]
cmd/go: handle path to cmd directory

Now it works to run 'go install' (no args) in cmd/go.

Fixes #2679.

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

13 years agofix build
Russ Cox [Thu, 12 Jan 2012 23:27:49 +0000 (15:27 -0800)]
fix build

TBR=gri
CC=golang-dev
https://golang.org/cl/5528090

13 years agocmd/go: handle cgo pkg-config pragmas
Russ Cox [Thu, 12 Jan 2012 23:04:39 +0000 (15:04 -0800)]
cmd/go: handle cgo pkg-config pragmas

Fixes #2681.

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

13 years agocgo: write _cgo_export.h to object directory, not source dir
Russ Cox [Thu, 12 Jan 2012 23:04:31 +0000 (15:04 -0800)]
cgo: write _cgo_export.h to object directory, not source dir

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

13 years agobuild: don't use a fixed filename in temp
Brad Fitzpatrick [Thu, 12 Jan 2012 22:45:32 +0000 (14:45 -0800)]
build: don't use a fixed filename in temp

Fixes #2688

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

13 years agojson: better error messages when the ,string option is misused
Brad Fitzpatrick [Thu, 12 Jan 2012 22:40:29 +0000 (14:40 -0800)]
json: better error messages when the ,string option is misused

Fixes #2331

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

13 years agogo/build: pass CgoLDFLAGS at end of link command
Russ Cox [Thu, 12 Jan 2012 21:44:02 +0000 (13:44 -0800)]
go/build: pass CgoLDFLAGS at end of link command

By the time a Unix linker gets to the end of the
command line it has forgotten what you told it
at the beginning of the command line, so you
have to put library arguments (like -lm) at the end.

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

13 years agonet/http: don't ignore Request.Write's Flush error
Brad Fitzpatrick [Thu, 12 Jan 2012 21:15:40 +0000 (13:15 -0800)]
net/http: don't ignore Request.Write's Flush error

Pointed out by nekotaroh in issue 2645

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

13 years agostrconv: implement fast path for rounding already short numbers.
Rémy Oudompheng [Thu, 12 Jan 2012 19:34:06 +0000 (11:34 -0800)]
strconv: implement fast path for rounding already short numbers.

benchmark                   old ns/op   new ns/op   delta
BenchmarkFormatFloatDecimal      3765        1386    -63%

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

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