]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

- Both these changes were long-standing TODOs.

- Added BenchmarkScan.

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

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

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

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

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

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

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

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

Fixes #2682.

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

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

1 minute is not enough for the slower builders.

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

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

Fixes #2678

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fixes #2624

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

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

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

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

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

Fixes #2579.

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

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

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

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

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

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

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

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

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

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

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

This fixes issue 2444.

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

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

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

Fixes #2231.

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

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

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

Fixes #2639.

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