]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agoio: document and test new CopyN return behavior
Brad Fitzpatrick [Wed, 13 Feb 2013 21:52:00 +0000 (13:52 -0800)]
io: document and test new CopyN return behavior

Changed accidentally in 28966b7b2f0c (CopyN using Copy).
Updating docs to be consistent with 29bf5ff5064e (ReadFull & ReadAtLeast)

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

12 years agocmd/5l: fix print format
Lucio De Re [Wed, 13 Feb 2013 21:47:33 +0000 (16:47 -0500)]
cmd/5l: fix print format

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

12 years agodatabase/sql: add currently-disabled broken test
Brad Fitzpatrick [Wed, 13 Feb 2013 20:00:03 +0000 (12:00 -0800)]
database/sql: add currently-disabled broken test

Update #3865

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

12 years agogo/types: adjust gcimporter to actual gc export data
Robert Griesemer [Wed, 13 Feb 2013 18:21:24 +0000 (10:21 -0800)]
go/types: adjust gcimporter to actual gc export data

Unexported field and method names that appear in the
export data (as part of some exported type) are fully
qualified with a package id (path). In some cases, a
package with that id was never exported for any other
use (i.e. only the path is of interest).

We must not create a "real" package in those cases
because we don't have a package name. Entering an
unnamed package into the map of imported packages
makes that package accessible for other imports.
Such a subsequent import may find the unnamed
package in the map, and reuse it. That reused and
imported package is then entered into the importing
file scope, still w/o a name. References to that
package cannot resolved after that. Was bug.

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

12 years agoruntime: instrument slicebytetostring for race detection
Dmitriy Vyukov [Wed, 13 Feb 2013 14:29:59 +0000 (18:29 +0400)]
runtime: instrument slicebytetostring for race detection

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

12 years agoarchive/tar: append a slash when deriving header info from a directory
Christian Himpel [Wed, 13 Feb 2013 08:23:28 +0000 (19:23 +1100)]
archive/tar: append a slash when deriving header info from a directory

This behavior is identical to GNU tar 1.26.

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

12 years agodoc: adjust indentation in Effective Go commentary example.
David Symonds [Wed, 13 Feb 2013 05:43:55 +0000 (16:43 +1100)]
doc: adjust indentation in Effective Go commentary example.

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

12 years agonet: change server_test.go so we could see failure messages
Alex Brainman [Wed, 13 Feb 2013 05:17:47 +0000 (16:17 +1100)]
net: change server_test.go so we could see failure messages

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

12 years agoexp/ssa: add Instruction.Operands and Value.Referrers methods.
Alan Donovan [Wed, 13 Feb 2013 05:15:07 +0000 (00:15 -0500)]
exp/ssa: add Instruction.Operands and Value.Referrers methods.

Operands returns the SSA values used by an instruction.
Referrers returns the SSA instructions that use a value, for
some values.  These will be used for SSA renaming, to follow.

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

12 years agogo/types: print, println accept 0 or more arguments
Robert Griesemer [Wed, 13 Feb 2013 03:40:20 +0000 (19:40 -0800)]
go/types: print, println accept 0 or more arguments

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

12 years agoos: do not use hosts file for windows tests
Alex Brainman [Wed, 13 Feb 2013 02:19:06 +0000 (13:19 +1100)]
os: do not use hosts file for windows tests

Not everyone has the file (http://golang.org/issue/4723#c4).

Update #4723.

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

12 years agoexp/ssa: omit Function's package name when printing intra-package references.
Alan Donovan [Tue, 12 Feb 2013 21:13:14 +0000 (16:13 -0500)]
exp/ssa: omit Function's package name when printing intra-package references.

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

12 years agoencoding/xml: fix htmlAutoClose and its generating script
Shenghou Ma [Tue, 12 Feb 2013 18:27:42 +0000 (02:27 +0800)]
encoding/xml: fix htmlAutoClose and its generating script
Thanks Mitică for reporting this.

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

12 years agotest: ensure all failing tests exit nonzero.
Alan Donovan [Tue, 12 Feb 2013 18:17:49 +0000 (13:17 -0500)]
test: ensure all failing tests exit nonzero.

Previously merely printing an error would cause the golden
file comparison (in 'bash run') to fail, but that is no longer
the case with the new run.go driver.

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

12 years agogo/build, runtime/cgo: cgo support for NetBSD/ARM
Shenghou Ma [Tue, 12 Feb 2013 17:06:52 +0000 (01:06 +0800)]
go/build, runtime/cgo: cgo support for NetBSD/ARM

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

12 years agosync/atomic: support NetBSD/ARM (ARM11 or above)
Shenghou Ma [Tue, 12 Feb 2013 17:04:13 +0000 (01:04 +0800)]
sync/atomic: support NetBSD/ARM (ARM11 or above)

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

12 years agosyscall: NetBSD/ARM support
Shenghou Ma [Tue, 12 Feb 2013 17:03:25 +0000 (01:03 +0800)]
syscall: NetBSD/ARM support

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

12 years agoruntime: NetBSD/ARM support
Shenghou Ma [Tue, 12 Feb 2013 17:00:04 +0000 (01:00 +0800)]
runtime: NetBSD/ARM support

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

12 years agoexp/locale/collate: moved low-level collation functionality
Marcel van Lohuizen [Tue, 12 Feb 2013 14:59:55 +0000 (15:59 +0100)]
exp/locale/collate: moved low-level collation functionality
into separate package.  This allows this code to be shared
with the search package without the need for these two to use
the same tables.
Adjusted various files accordingly.

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

12 years agogo/types: len(((*T)(nil)).X) is const if X is an array
Robert Griesemer [Tue, 12 Feb 2013 06:39:55 +0000 (22:39 -0800)]
go/types: len(((*T)(nil)).X) is const if X is an array

Fixes #4744.

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

12 years agoexp/ssa: special-case 'range' loops based on type of range expression.
Alan Donovan [Tue, 12 Feb 2013 03:12:56 +0000 (22:12 -0500)]
exp/ssa: special-case 'range' loops based on type of range expression.

The lowering of ast.RangeStmt now has three distinct cases:

1) rangeIter for maps and strings; approximately:
    it = range x
    for {
      k, v, ok = next it
      if !ok { break }
      ...
    }
   The Range instruction and the interpreter's "iter"
   datatype are now restricted to these types.

2) rangeChan for channels; approximately:
    for {
      k, ok = <-x
      if !ok { break }
      ...
    }

3) rangeIndexed for slices, arrays, and *array; approximately:
    for k, l = 0, len(x); k < l; k++ {
      v = x[k]
      ...
    }

In all cases we now evaluate the side effects of the range expression
exactly once, per comments on http://code.google.com/p/go/issues/detail?id=4644.

However the exact spec wording is still being discussed in
https://golang.org/cl/7307083/.  Further (small)
changes may be required once the dust settles.

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

12 years agotest: a number of fixes.
Alan Donovan [Mon, 11 Feb 2013 23:20:52 +0000 (18:20 -0500)]
test: a number of fixes.

Details:
- reorder.go: delete p8.
  (Once expectation is changed per b/4627 it is identical to p1.)
- switch.go: added some more (degenerate) switches.
- range.go: improved error messages in a few cases.
- method.go: added tests of calls to promoted methods.

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

12 years agovet: improve flag handling
Rob Pike [Mon, 11 Feb 2013 21:33:11 +0000 (13:33 -0800)]
vet: improve flag handling
Simplify the internal logic for flags controlling what to vet,
by introducing a map of flags that gathers them all together.
This change should simplify the process of adding further flags.

Add a test for untagged struct literals.
Delete a redundant test that was also in the wrong file.
Clean up some ERROR patterns that weren't working.

"make test" passes again.

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

12 years agoapi: Update readme.
Robin Eklind [Mon, 11 Feb 2013 17:10:35 +0000 (09:10 -0800)]
api: Update readme.

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

12 years agosync: add caution about where to call (*WaitGroup).Add
Russ Cox [Mon, 11 Feb 2013 13:05:46 +0000 (08:05 -0500)]
sync: add caution about where to call (*WaitGroup).Add

Fixes #4762.

R=daniel.morsing, adg
CC=golang-dev
https://golang.org/cl/7308045

12 years agospec: only require parens around ambiguous conversions
Russ Cox [Mon, 11 Feb 2013 12:48:14 +0000 (07:48 -0500)]
spec: only require parens around ambiguous conversions

This is documenting the status quo. The previous cleanup
added this language as an implementation restriction, but
at least for now it is really part of the language proper.

Fixes #4605.

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

12 years agospec: document fp rounding during explicit constant conversion
Russ Cox [Mon, 11 Feb 2013 12:47:41 +0000 (07:47 -0500)]
spec: document fp rounding during explicit constant conversion

The gc compilers already behave this way. It was an explicit
decision during the very long constant design discussions,
but it appears not to have made it into the spec.

Fixes #4398.

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

12 years agospec: reject top-level init names
Russ Cox [Mon, 11 Feb 2013 12:46:39 +0000 (07:46 -0500)]
spec: reject top-level init names

Fixes #4586.

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

12 years agomisc/dashboard: add missing return value
Andrew Gerrand [Mon, 11 Feb 2013 07:01:18 +0000 (18:01 +1100)]
misc/dashboard: add missing return value

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

12 years agocontainer/list: add package example
Andrew Gerrand [Mon, 11 Feb 2013 06:59:52 +0000 (17:59 +1100)]
container/list: add package example

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

12 years agoexp/html, exp/html/atom: delete, as they're moving to the go.net
Nigel Tao [Mon, 11 Feb 2013 00:56:49 +0000 (11:56 +1100)]
exp/html, exp/html/atom: delete, as they're moving to the go.net
sub-repo.

The matching change is at https://golang.org/cl/7310063

The rationale was discussed at
https://groups.google.com/d/topic/golang-nuts/Qq5hTQyPuLg/discussion

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

12 years agoexp/cookiejar: implementation of SetCookies
Volker Dobler [Mon, 11 Feb 2013 00:47:31 +0000 (11:47 +1100)]
exp/cookiejar: implementation of SetCookies

This CL provides the rest of the SetCookies code as well as
some test infrastructure which will be used to test also
the Cookies method. This test infrastructure is optimized
for readability and tries to make it easy to review table
driven test cases.

Tests for all the different corner cases of SetCookies
will be provided in a separate CL.

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

12 years agodoc: update contribute.html
Dave Cheney [Mon, 11 Feb 2013 00:40:33 +0000 (19:40 -0500)]
doc: update contribute.html

Fixes #4582.

* mentioned hg upload.
* added section on hg file.
* added small mention about being inside $GOROOT.
* added hg revert @NNNN
* reorganise the hg submit section for the common case of a non committer.
* made the Copyright section h2
* added note about leaving copyright years unchanged.

R=golang-dev, metanata4, shivakumar.gn, minux.ma, adg, shanemhansen
CC=golang-dev, metanata4
https://golang.org/cl/7278047

12 years agoarchive/tar: read/write extended pax/gnu tar archives
Shane Hansen [Mon, 11 Feb 2013 00:36:29 +0000 (11:36 +1100)]
archive/tar: read/write extended pax/gnu tar archives

Support reading pax archives and applying extended attributes
like long names, subsecond mtime resolutions, etc. Default to
writing pax archives for long file and link names.
Support reading gnu archives using the ././@LongLink extended
header for file name and link target.

Fixes #3300

R=dsymonds, dave, rogpeppe, remyoudompheng, chressie, rsc
CC=golang-dev
https://golang.org/cl/6700047

12 years agocmd/8l/asm.c: Unused function arguments, suppress warnings.
Lucio De Re [Sun, 10 Feb 2013 23:15:56 +0000 (10:15 +1100)]
cmd/8l/asm.c: Unused function arguments, suppress warnings.

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

12 years agodoc: move os specific build instructions to wiki
Dave Cheney [Sun, 10 Feb 2013 22:39:13 +0000 (17:39 -0500)]
doc: move os specific build instructions to wiki

Fixes #4010.

This proposal avoids cluttering the main install-source.html with OS specific instructions by linking to the wiki for details. See discussion in the comments.

R=adg, minux.ma
CC=golang-dev
https://golang.org/cl/7241068

12 years agodoc: link to wiki Projects page instead of old Project Dashboard.
Greg Ward [Sun, 10 Feb 2013 22:18:31 +0000 (09:18 +1100)]
doc: link to wiki Projects page instead of old Project Dashboard.

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

12 years agoA+C: Greg Ward (individual CLA)
Andrew Gerrand [Sun, 10 Feb 2013 22:17:00 +0000 (09:17 +1100)]
A+C: Greg Ward (individual CLA)

Generated by addca.

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

12 years agospec: clarify that any unsafe.Pointer type is okay in conversion
Russ Cox [Sat, 9 Feb 2013 22:36:31 +0000 (17:36 -0500)]
spec: clarify that any unsafe.Pointer type is okay in conversion

The spec is not clear about whether this is allowed or not,
but both compilers allow it, because the reflect implementation
takes advantage of it. Document current behavior.

Fixes #4679.

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

12 years agonet/http: more request benchmarks
Dave Cheney [Sat, 9 Feb 2013 21:18:09 +0000 (08:18 +1100)]
net/http: more request benchmarks

Add benchmarks for common http benchmarking tools. The intent is to catch optimisations which favor synthetic benchmarks that do not show improvements for real clients like Chrome.

BenchmarkReadRequestChrome        200000             10133 ns/op          60.29 MB/s        3148 B/op         32 allocs/op
BenchmarkReadRequestCurl          500000              4314 ns/op          18.08 MB/s         905 B/op         15 allocs/op
BenchmarkReadRequestApachebench   500000              4363 ns/op          18.79 MB/s         956 B/op         16 allocs/op
BenchmarkReadRequestSiege         500000              6408 ns/op          24.19 MB/s        1397 B/op         22 allocs/op
BenchmarkReadRequestWrk          1000000              2838 ns/op          14.09 MB/s         757 B/op         11 allocs/op

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

12 years agospec: clarify that f(g()) requires that g return >= 1 value
Russ Cox [Sat, 9 Feb 2013 19:46:55 +0000 (14:46 -0500)]
spec: clarify that f(g()) requires that g return >= 1 value

Fixes #4573.

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

12 years agocrypto/x509: disable SCG test with system validation.
Adam Langley [Sat, 9 Feb 2013 18:51:39 +0000 (13:51 -0500)]
crypto/x509: disable SCG test with system validation.

On Windows, CryptoAPI is finding an alternative validation path. Since
this is a little non-deterministic, this change disables that test
when using system validation.

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

12 years agotesting: be explicit about use of b.N
Russ Cox [Sat, 9 Feb 2013 18:43:15 +0000 (13:43 -0500)]
testing: be explicit about use of b.N

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

12 years agocrypto/x509: allow MS/NS SCG key usage as ServerAuth.
Adam Langley [Sat, 9 Feb 2013 18:20:25 +0000 (13:20 -0500)]
crypto/x509: allow MS/NS SCG key usage as ServerAuth.

By default, crypto/x509 assumes that users wish to validate
certificates for ServerAuth. However, due to historical reasons,
COMODO's intermediates don't specify ServerAuth as an allowed key
usage.

Rather NSS and CryptoAPI both allow these SGC OIDs to be equivalent to
ServerAuth.

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

12 years agobytes: annotate assembly functions with //go:noescape
Shenghou Ma [Sat, 9 Feb 2013 16:08:30 +0000 (00:08 +0800)]
bytes: annotate assembly functions with //go:noescape

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

12 years agolog/syslog: remove socket files after tests
Shenghou Ma [Sat, 9 Feb 2013 00:19:09 +0000 (08:19 +0800)]
log/syslog: remove socket files after tests

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

12 years agonet: fix unixgram
Mikio Hara [Fri, 8 Feb 2013 23:18:32 +0000 (08:18 +0900)]
net: fix unixgram

The socket for AF_UNIX domain with SOCK_DGARM type isn't
allowed to work with syscall listen.

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

12 years agocmd/go: indicate that flags unrecognized by 'go test' must follow package specification
Robert Daniel Kortschak [Fri, 8 Feb 2013 21:00:59 +0000 (16:00 -0500)]
cmd/go: indicate that flags unrecognized by 'go test' must follow package specification

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

12 years agoruntime: precise garbage collection of hashmaps
Jan Ziak [Fri, 8 Feb 2013 21:00:33 +0000 (16:00 -0500)]
runtime: precise garbage collection of hashmaps

R=golang-dev, rsc
CC=dave, dvyukov, golang-dev, minux.ma, remyoudompheng
https://golang.org/cl/7252047

12 years agonet/http: add BenchmarkReadRequest
Dave Cheney [Fri, 8 Feb 2013 20:04:07 +0000 (07:04 +1100)]
net/http: add BenchmarkReadRequest

Add benchmark for request parsing. Fixture data is taken from https://github.com/felixge/node-http-perf

% go version
go version devel +28966b7b2f0c Thu Feb 07 20:26:12 2013 -0800 linux/amd64

% go test -run=nil -bench=ReadRequest -benchtime=10s
PASS
BenchmarkReadRequest     2000000   9900 ns/op   61.71 MB/s   3148 B/op   32 allocs/op
ok      net/http        12.180s

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

12 years agosyscall: check for invalid characters in Setenv on Unix
Péter Surányi [Fri, 8 Feb 2013 18:45:46 +0000 (10:45 -0800)]
syscall: check for invalid characters in Setenv on Unix

On POSIX, '=' in key is explicitly invalid, and '\x00' in key/value is implicitly invalid.

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

12 years agonet/http/httptest: add examples
Kamil Kisiel [Fri, 8 Feb 2013 17:20:05 +0000 (09:20 -0800)]
net/http/httptest: add examples

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

12 years agoexp/ssa/interp: fix MS Windows breakage.
Alan Donovan [Fri, 8 Feb 2013 16:58:24 +0000 (11:58 -0500)]
exp/ssa/interp: fix MS Windows breakage.

syscall.{Kill,Write} are not portable to MS Windows, so we
disable them for now.

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

12 years agoexp/ssa: (#5 of 5): the SSA interpreter and 'ssadump' tool.
Alan Donovan [Fri, 8 Feb 2013 15:43:53 +0000 (10:43 -0500)]
exp/ssa: (#5 of 5): the SSA interpreter and 'ssadump' tool.

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

12 years agoruntime/race: deflake tests
Dmitriy Vyukov [Fri, 8 Feb 2013 15:24:50 +0000 (19:24 +0400)]
runtime/race: deflake tests
With the new scheduler races in the tests are reported during execution of other tests.
The change joins goroutines started during the tests.

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

12 years agoruntime: fix integer overflow
Dmitriy Vyukov [Fri, 8 Feb 2013 15:05:19 +0000 (19:05 +0400)]
runtime: fix integer overflow
The problem happens when end=0, then end-1 is very big number.
Observed with the new scheduler.

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

12 years agonet: simplify Dial, Listen, ListenPacket and those helpers
Mikio Hara [Fri, 8 Feb 2013 12:53:10 +0000 (21:53 +0900)]
net: simplify Dial, Listen, ListenPacket and those helpers

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

12 years agonet: delete duplicate listenerSockaddr
Mikio Hara [Fri, 8 Feb 2013 08:02:08 +0000 (17:02 +0900)]
net: delete duplicate listenerSockaddr

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

12 years agocmd/5g: add missing splitclean.
Rémy Oudompheng [Fri, 8 Feb 2013 07:19:47 +0000 (08:19 +0100)]
cmd/5g: add missing splitclean.

See issue 887 for the 8g analogue.

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

12 years agoruntime: fix build for Linux/ARM
Shenghou Ma [Fri, 8 Feb 2013 05:24:38 +0000 (13:24 +0800)]
runtime: fix build for Linux/ARM

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

12 years agoio: Simplify CopyN implementation by delegating to Copy.
Jeremy Schlatter [Fri, 8 Feb 2013 04:26:12 +0000 (20:26 -0800)]
io: Simplify CopyN implementation by delegating to Copy.

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

12 years agoC: add Jeremy Schlatter (Google CLA)
Brad Fitzpatrick [Fri, 8 Feb 2013 04:25:10 +0000 (20:25 -0800)]
C: add Jeremy Schlatter (Google CLA)

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

12 years agocodereview: use hgapplydiff instead of hgpatch
Russ Cox [Fri, 8 Feb 2013 04:15:08 +0000 (23:15 -0500)]
codereview: use hgapplydiff instead of hgpatch

Depends on https://golang.org/cl/7308067

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

12 years agonet: do not use RLock around Accept
Russ Cox [Fri, 8 Feb 2013 03:45:12 +0000 (22:45 -0500)]
net: do not use RLock around Accept

It might be non-blocking, but it also might be blocking.
Cannot take the chance, as Accept might block indefinitely
and make it impossible to acquire ForkLock exclusively
(during fork+exec).

Fixes #4737.

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

12 years agocmd/godoc: fix format strings.
David Symonds [Fri, 8 Feb 2013 01:00:35 +0000 (12:00 +1100)]
cmd/godoc: fix format strings.

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

12 years agobytes: minor optimization to lastIndexFunc
Brad Fitzpatrick [Fri, 8 Feb 2013 00:00:06 +0000 (16:00 -0800)]
bytes: minor optimization to lastIndexFunc

Before and after:
BenchmarkTrimSpace  20000000   81.3 ns/op
BenchmarkTrimSpace  50000000   58.0 ns/op

(most whitespace trimming is ASCII whitespace)

Same optimization appeared a handful of other places
in this file, but not here.

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

12 years agocmd/8g: add a few missing splitclean
Russ Cox [Thu, 7 Feb 2013 22:55:25 +0000 (17:55 -0500)]
cmd/8g: add a few missing splitclean

Fixes #887.

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

12 years agocrypto/md5: fix for big-endian processors
Ian Lance Taylor [Thu, 7 Feb 2013 21:31:53 +0000 (13:31 -0800)]
crypto/md5: fix for big-endian processors

R=golang-dev, minux.ma, agl
CC=golang-dev
https://golang.org/cl/7305059

12 years agonet: skip TestMulticastListener on Solaris
Ian Lance Taylor [Thu, 7 Feb 2013 17:58:42 +0000 (09:58 -0800)]
net: skip TestMulticastListener on Solaris

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

12 years agoos/exec: LookPath on Unix shouldn't look in cwd when PATH is empty
Péter Surányi [Thu, 7 Feb 2013 14:41:35 +0000 (06:41 -0800)]
os/exec: LookPath on Unix shouldn't look in cwd when PATH is empty

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

12 years agocrypto/rc4: naïve ARM assembly implementation
Shenghou Ma [Thu, 7 Feb 2013 10:54:21 +0000 (18:54 +0800)]
crypto/rc4: naïve ARM assembly implementation

On 800MHz Cortex-A8:
benchmark           old ns/op    new ns/op    delta
BenchmarkRC4_128         9395         2838  -69.79%
BenchmarkRC4_1K         74497        22120  -70.31%
BenchmarkRC4_8K        587243       171435  -70.81%

benchmark            old MB/s     new MB/s  speedup
BenchmarkRC4_128        13.62        45.09    3.31x
BenchmarkRC4_1K         13.75        46.29    3.37x
BenchmarkRC4_8K         13.79        47.22    3.42x

Result for "OpenSSL 1.0.1c 10 May 2012" from Debian/armhf sid:
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
rc4              39553.81k    46522.39k    49336.11k    50085.63k    50258.06k

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

12 years agonet: permit pollster DelFD to return whether to call Wakeup
Ian Lance Taylor [Thu, 7 Feb 2013 01:18:53 +0000 (17:18 -0800)]
net: permit pollster DelFD to return whether to call Wakeup

This is necessary for systems that use select as the pollster,
such as Solaris (supported by gccgo).  It corresponds to the
bool returned by AddFD.  In general it's not clearly defined
what happens when a descriptor used in a select is closed, and
different systems behave differently.  Waking up the select
will cause the right thing to happen: the closed descriptor
will be dropped from the next iteration.

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

12 years agosync: improve WaitGroup example by putting the call to Done in a
Gaal Yahas [Wed, 6 Feb 2013 16:39:52 +0000 (00:39 +0800)]
sync: improve WaitGroup example by putting the call to Done in a
deferred block. This makes hangs in the waiting code less likely
if a goroutine exits abnormally.

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

12 years agoCONTRIBUTORS: add Gaal Yahas (Google CLA)
Ian Lance Taylor [Wed, 6 Feb 2013 16:21:03 +0000 (08:21 -0800)]
CONTRIBUTORS: add Gaal Yahas (Google CLA)

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

12 years agosyscall, net: Fix unix socket autobind on Linux.
Albert Strasheim [Wed, 6 Feb 2013 14:45:57 +0000 (06:45 -0800)]
syscall, net: Fix unix socket autobind on Linux.

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

12 years agoexp/cookiejar: infrastructure for upcoming implementation
Volker Dobler [Wed, 6 Feb 2013 11:37:34 +0000 (22:37 +1100)]
exp/cookiejar: infrastructure for upcoming implementation

This CL is the first of a handful of CLs which will provide
the implementation of cookiejar. It contains several helper
functions and the skeleton of Cookies and SetCookies.

Proper host name handling requires the ToASCII transformation
from package idna which currently lives in the go.net
subrepo. This CL thus contains just a TODO for this issue.

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

12 years agodoc/articles/error_handling: no more os.Error
Shenghou Ma [Wed, 6 Feb 2013 10:32:54 +0000 (18:32 +0800)]
doc/articles/error_handling: no more os.Error

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

12 years agoruntime/race: switch to explicit race context instead of goroutine id's
Dmitriy Vyukov [Wed, 6 Feb 2013 07:40:54 +0000 (11:40 +0400)]
runtime/race: switch to explicit race context instead of goroutine id's
Removes limit on maximum number of goroutines ever existed.
code.google.com/p/goexecutor tests now pass successfully.
Also slightly improves performance.
Before: $ time ./flate.test -test.short
real 0m9.314s
After:  $ time ./flate.test -test.short
real 0m8.958s
Fixes #4286.
The runtime is built from llvm rev 174312.

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

12 years agolog/syslog: retry once if write fails
Jeff R. Allen [Tue, 5 Feb 2013 17:54:01 +0000 (09:54 -0800)]
log/syslog: retry once if write fails

Implements deferred connections + single-attempt automatic
retry. Based on CL 5078042 from kuroneko.

Fixes #2264.

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

12 years agoruntime: save LR to stack when panicking to handle leaf function traceback
Shenghou Ma [Tue, 5 Feb 2013 17:18:37 +0000 (01:18 +0800)]
runtime: save LR to stack when panicking to handle leaf function traceback

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

12 years agolib9: fix build for windows
Shenghou Ma [Tue, 5 Feb 2013 16:33:25 +0000 (00:33 +0800)]
lib9: fix build for windows

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

12 years agoexp/inotify: close event channel before file descriptor
Ian Lance Taylor [Tue, 5 Feb 2013 14:11:10 +0000 (06:11 -0800)]
exp/inotify: close event channel before file descriptor

Closing the inotify file descriptor can take over a second
when running on Ubuntu Precise in an NFS directory, leading to
the test error in issue 3132.  Closing the event channel first
lets a client that does not care about the error channel move
on.

Fixes #3132.

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

12 years agocmd/dist: add -Wstrict-prototypes to CFLAGS and fix all the compiler errors
Shenghou Ma [Tue, 5 Feb 2013 13:43:04 +0000 (21:43 +0800)]
cmd/dist: add -Wstrict-prototypes to CFLAGS and fix all the compiler errors
Plan 9 compilers insist this but as we don't have Plan 9
builders, we'd better let gcc check the prototypes.

Inspired by CL 7289050.

R=golang-dev, seed, dave, rsc, lucio.dere
CC=akumar, golang-dev
https://golang.org/cl/7288056

12 years agocontainer/heap: fix comment typo in example test
Caleb Spare [Tue, 5 Feb 2013 12:06:00 +0000 (07:06 -0500)]
container/heap: fix comment typo in example test

This updates a bad reference to a method name in the example priority queue test.

The error was introduced in the example refactoring in rev. 2ea8f07b2ffe.

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

12 years agocmd/gc: add way to specify 'noescape' for extern funcs
Russ Cox [Tue, 5 Feb 2013 12:00:38 +0000 (07:00 -0500)]
cmd/gc: add way to specify 'noescape' for extern funcs

A new comment directive //go:noescape instructs the compiler
that the following external (no body) func declaration should be
treated as if none of its arguments escape to the heap.

Fixes #4099.

R=golang-dev, dave, minux.ma, daniel.morsing, remyoudompheng, adg, agl, iant
CC=golang-dev
https://golang.org/cl/7289048

12 years agomisc/dashboard/app: trim old builds from the history
Dave Cheney [Tue, 5 Feb 2013 09:50:20 +0000 (20:50 +1100)]
misc/dashboard/app: trim old builds from the history

The dashboard is currently failing to store results of new builds for some keys, notable the go.codereview sub repository. This is causing the builders to mark the entire triggering commit as failed. With the help of David Symonds we think it is because the results value has breached the 1mb datastore limit on AppEngine.

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

12 years agoruntime/race: do not include pthread.h
Dmitriy Vyukov [Tue, 5 Feb 2013 09:08:07 +0000 (13:08 +0400)]
runtime/race: do not include pthread.h
Fixes #4721.

R=alex.brainman, minux.ma
CC=golang-dev
https://golang.org/cl/7275048

12 years agoarchive/tar: small simplification using FileMode.
David Symonds [Tue, 5 Feb 2013 04:39:55 +0000 (15:39 +1100)]
archive/tar: small simplification using FileMode.

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

12 years agonet/http: fix Server blocking after a Handler's Write fails
Brad Fitzpatrick [Tue, 5 Feb 2013 04:26:25 +0000 (20:26 -0800)]
net/http: fix Server blocking after a Handler's Write fails

If a Handle's Write to a ResponseWriter fails (e.g. via a
net.Conn WriteDeadline via WriteTimeout on the Server), the
Server was blocking forever waiting for reads on that
net.Conn, even after a Write failed.

Instead, once we see a Write fail, close the connection,
since it's then dead to us anyway.

Fixes #4741

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

12 years agopath/filepath: document that Walk does not follow symlinks
Russ Cox [Tue, 5 Feb 2013 03:59:30 +0000 (22:59 -0500)]
path/filepath: document that Walk does not follow symlinks

Fixes #4759.

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

12 years agocmd/gc: fix escape analysis
Russ Cox [Tue, 5 Feb 2013 03:48:31 +0000 (22:48 -0500)]
cmd/gc: fix escape analysis

If the analysis reached a node twice, then the analysis was cut off.
However, if the second arrival is at a lower depth (closer to escaping)
then it is important to repeat the traversal.

The repeating must be cut off at some point to avoid the occasional
infinite recursion. This CL cuts it off as soon as possible while still
passing all tests.

Fixes #4751.

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

12 years agosyscall: fix marshaling of stat messages on Plan 9
Anthony Martin [Tue, 5 Feb 2013 03:47:23 +0000 (19:47 -0800)]
syscall: fix marshaling of stat messages on Plan 9

The order of the Qid fields was reversed. Mea culpa.

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

12 years agonet/http: add Next Protocol Negotation upgrade support to the Server
Brad Fitzpatrick [Mon, 4 Feb 2013 21:55:38 +0000 (13:55 -0800)]
net/http: add Next Protocol Negotation upgrade support to the Server

This provides the mechanism to connect SPDY support to the http
package, without pulling SPDY into the standard library.

R=rsc, agl, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/7287045

12 years agosyscall: regenerate ztype files for linux
Mikio Hara [Mon, 4 Feb 2013 21:53:58 +0000 (06:53 +0900)]
syscall: regenerate ztype files for linux

This CL adds TCPInfo struct to linux/386,arm.
It's already added to linux/amd64.

Note that not sure the reason but cgo godefs w/ latest gcc
translates a flexible array member in structures correctly,
handles it as a non-incomplete, non-opaque type, on Go 1.
This CL reverts such changes by hand for the Go 1 contract.

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

12 years agonet/http: fix when server deadlines get extended
Brad Fitzpatrick [Mon, 4 Feb 2013 21:52:45 +0000 (13:52 -0800)]
net/http: fix when server deadlines get extended

Deadlines should be extended at the beginning of
a request, not at the beginning of a connection.

Fixes #4676

R=golang-dev, fullung, patrick.allen.higgins, adg
CC=golang-dev
https://golang.org/cl/7220076

12 years agocmd/go: update doc.go
Shenghou Ma [Mon, 4 Feb 2013 21:45:35 +0000 (05:45 +0800)]
cmd/go: update doc.go

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

12 years agoexp/ssa: (#4 of 5): the SSA builder.
Alan Donovan [Mon, 4 Feb 2013 17:22:35 +0000 (12:22 -0500)]
exp/ssa: (#4 of 5): the SSA builder.

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

12 years agocmd/gc: fix &^ code generation bug
Russ Cox [Mon, 4 Feb 2013 05:21:44 +0000 (00:21 -0500)]
cmd/gc: fix &^ code generation bug

Was not re-walking the new AND node, so that its ullman
count was wrong, so that the code generator attempted to
store values in registers across the call.

Fixes #4752.

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

12 years agonet: use windows sysSocket everywhere
Alex Brainman [Mon, 4 Feb 2013 05:03:41 +0000 (16:03 +1100)]
net: use windows sysSocket everywhere

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

12 years agoruntime/debug: add controls for garbage collector
Russ Cox [Mon, 4 Feb 2013 05:00:55 +0000 (00:00 -0500)]
runtime/debug: add controls for garbage collector

Fixes #4090.

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