]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agocompress/flate: add Encoder/Decoder benchmarks
Dave Cheney [Sun, 29 Apr 2012 10:41:13 +0000 (20:41 +1000)]
compress/flate: add Encoder/Decoder benchmarks

In CL 6127051, nigeltao suggested that further gains
were possible by improving the performance of flate.
This CL adds a set of benchmarks (based on compress/lzw)
that can be used to judge any future improvements.

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

13 years agomisc/dashboard/codereview: don't depend on map iteration order for unit calculation.
David Symonds [Fri, 27 Apr 2012 23:47:15 +0000 (09:47 +1000)]
misc/dashboard/codereview: don't depend on map iteration order for unit calculation.

Fix auth requirements for /gc endpoint too.

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

13 years agoos/exec: close all internal descriptors when Cmd.Start() fails.
Brian Dellisanti [Fri, 27 Apr 2012 22:46:49 +0000 (15:46 -0700)]
os/exec: close all internal descriptors when Cmd.Start() fails.

This closes any internal descriptors (pipes, etc) that Cmd.Start() had
opened before it failed.

Fixes #3468.

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

13 years agoA+C: add Brian Dellisanti (individual CLA)
Ian Lance Taylor [Fri, 27 Apr 2012 22:46:27 +0000 (15:46 -0700)]
A+C: add Brian Dellisanti (individual CLA)

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

13 years agomisc/dashboard/codereview: simplify parallel operations for front page, and capture...
David Symonds [Fri, 27 Apr 2012 13:16:54 +0000 (23:16 +1000)]
misc/dashboard/codereview: simplify parallel operations for front page, and capture timing info.

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

13 years agonet: consolidate common socket functions
Dave Cheney [Fri, 27 Apr 2012 12:17:08 +0000 (22:17 +1000)]
net: consolidate common socket functions

In resolving 3507, the fix had to be applied individually to
the four *Conn types, tcp, udp, rawip and unix, due to the
duplicate code in each Conn type.

This CL consolidates the common net.Conn methods that all four
*Conn types implement into a base conn type.

Pros:
* The fix for 3507 would have only needed to be applied to one
method. Further improvements, such as possibly removing the
c.fd != nil check in c.ok(), would benefit from this CL.
* Nearly 300 lines removed from the net package.
* The public interface and documentation are not changed.
* I think this is an excellent example of the power of embedding.

Cons:
* The net package is already distributed over many files, this
CL adds another place to look.
* The fix for 3507 was a total of 16 lines changed, this follow
up CL could be considered to be an overreaction as new Conn types
are unlikely to be added in the near future.

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

13 years agomisc/dashboard/codereview: more abbreviated modification duration.
David Symonds [Fri, 27 Apr 2012 07:12:09 +0000 (17:12 +1000)]
misc/dashboard/codereview: more abbreviated modification duration.

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

13 years agomisc/dashboard/codereview: new app.
David Symonds [Fri, 27 Apr 2012 06:36:02 +0000 (16:36 +1000)]
misc/dashboard/codereview: new app.

This is live at http://gocodereview.appspot.com/.

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

13 years agoimage/png: speed up PNG decoding for common color models: Gray, NRGBA,
Nigel Tao [Fri, 27 Apr 2012 06:03:58 +0000 (16:03 +1000)]
image/png: speed up PNG decoding for common color models: Gray, NRGBA,
Paletted, RGBA.

benchmark                       old ns/op    new ns/op    delta
BenchmarkDecodeGray               3681144      2536049  -31.11%
BenchmarkDecodeNRGBAGradient     12108660     10020650  -17.24%
BenchmarkDecodeNRGBAOpaque       10699230      8677165  -18.90%
BenchmarkDecodePaletted           2562806      1458798  -43.08%
BenchmarkDecodeRGB                8468175      7180730  -15.20%

benchmark                        old MB/s     new MB/s  speedup
BenchmarkDecodeGray                 17.80        25.84    1.45x
BenchmarkDecodeNRGBAGradient        21.65        26.16    1.21x
BenchmarkDecodeNRGBAOpaque          24.50        30.21    1.23x
BenchmarkDecodePaletted             25.57        44.92    1.76x
BenchmarkDecodeRGB                  30.96        36.51    1.18x

$ file $GOROOT/src/pkg/image/png/testdata/bench*
benchGray.png:           PNG image, 256 x 256, 8-bit grayscale, non-interlaced
benchNRGBA-gradient.png: PNG image, 256 x 256, 8-bit/color RGBA, non-interlaced
benchNRGBA-opaque.png:   PNG image, 256 x 256, 8-bit/color RGBA, non-interlaced
benchPaletted.png:       PNG image, 256 x 256, 8-bit colormap, non-interlaced
benchRGB.png:            PNG image, 256 x 256, 8-bit/color RGB, non-interlaced

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

13 years agoold/regexp, old/template: delete.
David Symonds [Fri, 27 Apr 2012 05:12:24 +0000 (15:12 +1000)]
old/regexp, old/template: delete.

Both of these have replacements.

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

13 years agopath/filepath: fix typo
Anthony Martin [Fri, 27 Apr 2012 00:25:19 +0000 (10:25 +1000)]
path/filepath: fix typo

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

13 years agomisc/dist: drop repetition in filenames, default to release tag
Andrew Gerrand [Thu, 26 Apr 2012 20:25:53 +0000 (13:25 -0700)]
misc/dist: drop repetition in filenames, default to release tag

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

13 years agore-tag go1.0.1
Andrew Gerrand [Thu, 26 Apr 2012 19:51:55 +0000 (12:51 -0700)]
re-tag go1.0.1

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

13 years agotag go1.0.1
Andrew Gerrand [Thu, 26 Apr 2012 19:34:30 +0000 (12:34 -0700)]
tag go1.0.1

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

13 years agodoc: go1.0.1 release notes
Andrew Gerrand [Thu, 26 Apr 2012 19:02:06 +0000 (12:02 -0700)]
doc: go1.0.1 release notes

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

13 years agocmd/go: new tag selection logic
Russ Cox [Thu, 26 Apr 2012 18:25:28 +0000 (14:25 -0400)]
cmd/go: new tag selection logic

The new logic is "use go1 if it's there, otherwise no tag."
Nothing needs to say "I require go1.0.1", and I want to
preserve some flexibility in defining what tags mean.

Right now (before go1.0.1) there is only one possible tag,
"go1", and I'd like to keep it that way.

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

13 years agosyscall: remove sysctl workaround for openbsd
Joel Sing [Thu, 26 Apr 2012 15:45:15 +0000 (01:45 +1000)]
syscall: remove sysctl workaround for openbsd

Now that Go will no longer work on OpenBSD versions prior to 5.1,
remove the sysctl workaround that was needed for 5.0 and earlier.

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

13 years agosyscall: fix a number of exec bugs on Plan 9
Anthony Martin [Thu, 26 Apr 2012 09:59:13 +0000 (02:59 -0700)]
syscall: fix a number of exec bugs on Plan 9

1. Readdirnames was erroneously returning an
   empty slice on every invocation.

2. The logic for determining which files to
   close before exec was incorrect.  If the
   set of files to be kept open (provided by
   the caller) did not include the files
   opened at startup, those files would be
   accidentally closed.

I also cleaned up readdupdevice while I was
in the vicinity.

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

13 years agogc: use correct line number for EOF syntax error
Anthony Martin [Thu, 26 Apr 2012 09:57:23 +0000 (02:57 -0700)]
gc: use correct line number for EOF syntax error

I also added some debugging code that's turned
on with -xx.

Fixes #3392.

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

13 years agodoc: update wiki article to use html/template properly.
David Symonds [Thu, 26 Apr 2012 07:50:44 +0000 (17:50 +1000)]
doc: update wiki article to use html/template properly.

Fixes #3569.

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

13 years agodoc: simplify the image_draw article example for converting an image to
Nigel Tao [Thu, 26 Apr 2012 07:39:04 +0000 (17:39 +1000)]
doc: simplify the image_draw article example for converting an image to
RGBA.

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

13 years agocmd/godoc: update App Engine README and script for Go 1
Shenghou Ma [Thu, 26 Apr 2012 06:24:53 +0000 (14:24 +0800)]
cmd/godoc: update App Engine README and script for Go 1

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

13 years agoexp/html: adjust inTableBodyIM to match spec
Andrew Balholm [Thu, 26 Apr 2012 01:48:35 +0000 (11:48 +1000)]
exp/html: adjust inTableBodyIM to match spec

Clean up flow of control.

Handle </tbody>, </tfoot>, and </thead>.

Pass 5 additional tests.

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

13 years agotime: doc fix.
David Symonds [Thu, 26 Apr 2012 01:28:35 +0000 (11:28 +1000)]
time: doc fix.

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

13 years agocodereview: look for new release branches
Russ Cox [Wed, 25 Apr 2012 20:44:30 +0000 (13:44 -0700)]
codereview: look for new release branches

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

13 years agodashboard: sort user interface by internal counter, not date
Andrew Gerrand [Wed, 25 Apr 2012 20:01:08 +0000 (13:01 -0700)]
dashboard: sort user interface by internal counter, not date

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

13 years agonet/http: ignore paths on CONNECT requests in ServeMux
Brad Fitzpatrick [Wed, 25 Apr 2012 19:46:16 +0000 (12:46 -0700)]
net/http: ignore paths on CONNECT requests in ServeMux

Fixes #3538

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

13 years agomime: make ParseMediaType return zero results on error
Brad Fitzpatrick [Wed, 25 Apr 2012 19:01:01 +0000 (12:01 -0700)]
mime: make ParseMediaType return zero results on error

Fixes #3562

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

13 years agoruntime: use __tfork() syscall on openbsd
Joel Sing [Wed, 25 Apr 2012 14:08:02 +0000 (00:08 +1000)]
runtime: use __tfork() syscall on openbsd

Switch from using the rfork() syscall on OpenBSD, to the __tfork()
syscall.  The __tfork() syscall is the preferred way of creating
system threads and the rfork() syscall has recently been removed.

Note: this will break compatibility with OpenBSD releases prior to 5.1.

R=golang-dev, bradfitz, devon.odell, rsc
CC=golang-dev
https://golang.org/cl/6037048

13 years agoexp/locale/collate: Added Builder type for generating a complete
Marcel van Lohuizen [Wed, 25 Apr 2012 11:19:35 +0000 (13:19 +0200)]
exp/locale/collate: Added Builder type for generating a complete
collation table. At this moment, it only implements the generation of
a root table.

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

13 years agoexp/locale/collate: Added skeleton for the higher-level types to provide
Marcel van Lohuizen [Wed, 25 Apr 2012 11:19:00 +0000 (13:19 +0200)]
exp/locale/collate: Added skeleton for the higher-level types to provide
context for change lists of lower-level types. The public APIs are defined
in builder.go and collate.go. Type table is the glue between the lower and
higher level code and might be a good starting point for understanding the
collation code.

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

13 years agoexp/locale/collate: added trie for associating colElems to runes.
Marcel van Lohuizen [Wed, 25 Apr 2012 11:16:57 +0000 (13:16 +0200)]
exp/locale/collate: added trie for associating colElems to runes.
The trie code looks a lot like the trie in exp/norm. It uses different
types, however.  Also, there is only a lookup for []byte and the unsafe
lookup methods have been dropped, as well as sparse mode.
There is now a method for generating a trie. To output Go code, one now needs
to first generate a trie and then call print() on it.

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

13 years agoexp/locale/collate: added representation for collation elements
Marcel van Lohuizen [Wed, 25 Apr 2012 11:16:24 +0000 (13:16 +0200)]
exp/locale/collate: added representation for collation elements
(see http://www.unicode.org/reports/tr10/).

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

13 years agoexp/locale/collate: implementation of trie that is used for detecting contractions.
Marcel van Lohuizen [Wed, 25 Apr 2012 11:15:48 +0000 (13:15 +0200)]
exp/locale/collate: implementation of trie that is used for detecting contractions.
(See http://www.unicode.org/reports/tr10/#Contractions.)  Each rune that is at the
start of any contraction is associated a trie. This trie, in turn, may be shared
by other runes that have the same set of suffixes.

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

13 years agonet/http: revert 97d027b3aa68
Gustavo Niemeyer [Wed, 25 Apr 2012 05:32:51 +0000 (02:32 -0300)]
net/http: revert 97d027b3aa68

Revert the following change set:

        changeset:   13018:97d027b3aa68
        user:        Gustavo Niemeyer <gustavo@niemeyer.net>
        date:        Mon Apr 23 22:00:16 2012 -0300
        summary:     net/http: allow clients to disable keep-alive

This broke a test on Windows 64 and somebody else
will have to check.

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

13 years agocrypto/rand: use io.ReadFull in test
Ian Lance Taylor [Wed, 25 Apr 2012 04:36:42 +0000 (21:36 -0700)]
crypto/rand: use io.ReadFull in test

On Solaris versions before Solaris 11, the kernel will not
return more than 1040 on a single read from /dev/urandom.

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

13 years agoencoding/json: allow punctuation in tag names
Bobby Powers [Wed, 25 Apr 2012 04:33:33 +0000 (14:33 +1000)]
encoding/json: allow punctuation in tag names

everything except backslash and the quote chars is fair game.

Fixes #3546.

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

13 years agonet: fix crash of Listen with "" or nil laddr
Mikio Hara [Wed, 25 Apr 2012 03:29:14 +0000 (12:29 +0900)]
net: fix crash of Listen with "" or nil laddr

Fixes #3584.

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

13 years agobytes: add assembly version of IndexByte for ARM
Dave Cheney [Wed, 25 Apr 2012 03:18:31 +0000 (13:18 +1000)]
bytes: add assembly version of IndexByte for ARM

benchmark                        old ns/op    new ns/op    delta
BenchmarkIndexByte32                   459          126  -72.55%
BenchmarkIndexByte4K                 52404        10939  -79.13%
BenchmarkIndexByte4M              54470800     11177370  -79.48%
BenchmarkIndexByte64M           1010803000    178860500  -82.31%

benchmark                         old MB/s     new MB/s  speedup
BenchmarkIndexByte32                 69.58       252.63    3.63x
BenchmarkIndexByte4K                 78.16       374.42    4.79x
BenchmarkIndexByte4M                 77.00       375.25    4.87x
BenchmarkIndexByte64M                66.39       375.20    5.65x

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

13 years agovet: check values for named constants as well as literals.
Rob Pike [Wed, 25 Apr 2012 02:14:38 +0000 (12:14 +1000)]
vet: check values for named constants as well as literals.
As in:
        const format = "%s"
        fmt.Printf(format, "hi")
Also fix a couple of bugs by rewriting the routine.

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

13 years agoall: fix errors found by go vet
Rob Pike [Wed, 25 Apr 2012 01:33:27 +0000 (11:33 +1000)]
all: fix errors found by go vet

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

13 years agoexp/html: adjust inTableIM to match spec
Andrew Balholm [Wed, 25 Apr 2012 00:49:27 +0000 (10:49 +1000)]
exp/html: adjust inTableIM to match spec

Don't foster-parent text nodes that consist only of whitespace.
(I implemented this entirely in inTableIM instead of creating an
inTableTextIM, because the sole purpose of inTableTextIM seems to be
to combine character tokens into a string, which our tokenizer does
already.)

Use parseImpliedToken to clarify a couple of cases.

Handle <style>, <script>, <input>, and <form>.

Ignore doctype tokens.

Pass 20 additional tests.

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

13 years agotest: add test for order of evaluation of map index on left of =
Ian Lance Taylor [Tue, 24 Apr 2012 17:17:26 +0000 (10:17 -0700)]
test: add test for order of evaluation of map index on left of =

Gccgo used to get this wrong.

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

13 years agomisc/dist: more gophers for OS X installer
Mikkel Krautz [Tue, 24 Apr 2012 16:24:19 +0000 (09:24 -0700)]
misc/dist: more gophers for OS X installer

Replaces the default OS X installer background
with a more fitting image.

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

13 years agoruntime: fix runtime.Breakpoint for ARM
Shenghou Ma [Tue, 24 Apr 2012 15:19:44 +0000 (23:19 +0800)]
runtime: fix runtime.Breakpoint for ARM

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

13 years agocmd/5g: fix URL typo
Shenghou Ma [Tue, 24 Apr 2012 15:17:16 +0000 (23:17 +0800)]
cmd/5g: fix URL typo

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

13 years agoexp/html: make inBodyIM match spec
Andrew Balholm [Tue, 24 Apr 2012 05:27:48 +0000 (15:27 +1000)]
exp/html: make inBodyIM match spec

This CL corrects the remaining differences that I could find between the
implementation of inBodyIM and the spec:

Handle <rp> and <rt>.

Adjust SVG and MathML attributes.

Reconstruct active formatting elements in the "any other start tag" case.

Pass 7 additional tests.

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

13 years agomime/multipart: report io.EOF correctly on part ending without newlines
Brad Fitzpatrick [Tue, 24 Apr 2012 05:26:48 +0000 (22:26 -0700)]
mime/multipart: report io.EOF correctly on part ending without newlines

If a part ends with "--boundary--", without a final "\r\n",
that's also a graceful EOF, and we should return io.EOF instead
of the fmt-wrapped io.EOF from bufio.Reader.ReadSlice.

I found this bug parsing an image attachment from gmail.
Minimal test case stripped down from the original
gmail-generated attachment included.

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

13 years agopath: document that Clean deletes trailing slashes.
Rob Pike [Tue, 24 Apr 2012 03:17:05 +0000 (13:17 +1000)]
path: document that Clean deletes trailing slashes.

Fixes #3492.

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

13 years agotext/template: improve the error reporting for unexported fields.
Rob Pike [Tue, 24 Apr 2012 03:11:59 +0000 (13:11 +1000)]
text/template: improve the error reporting for unexported fields.
Changes suggested by rsc after last CL.

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

13 years agonet/http: allow clients to disable keep-alive
Gustavo Niemeyer [Tue, 24 Apr 2012 01:00:16 +0000 (22:00 -0300)]
net/http: allow clients to disable keep-alive

Fixes #3540.

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

13 years agonet: fix typo in Listener.File() documentation
Rémy Oudompheng [Mon, 23 Apr 2012 23:27:19 +0000 (01:27 +0200)]
net: fix typo in Listener.File() documentation

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

13 years agotest: test handling of negative float constants
Ian Lance Taylor [Mon, 23 Apr 2012 22:47:34 +0000 (15:47 -0700)]
test: test handling of negative float constants

This used to panic when compiled by gccgo.

Updates #2876.

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

13 years agotime: change float expression to ensure it is an integer
Ian Lance Taylor [Mon, 23 Apr 2012 22:46:54 +0000 (15:46 -0700)]
time: change float expression to ensure it is an integer

When I increased the number of bits that gccgo uses for
untyped floats, the expression 0.52*1e9 was no longer
integral.  This patch fixes that.

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

13 years agomisc/dist: require 10.6 or later for OS X .pkgs
Mikkel Krautz [Mon, 23 Apr 2012 21:56:03 +0000 (14:56 -0700)]
misc/dist: require 10.6 or later for OS X .pkgs

This changes the misc/dist program to generate OS X
packages using pkgbuild and productbuild.

The productbuild utility makes it easy to generate
packages with a custom Distribution file.  This allows
us to add an installcheck script that presents a
friendly message to users who are running on an old
version of Mac OS X.

The change also fixes a few issues with the
postinstall script:

 - In-repo version of the script has been made
   executable. Installers generated using the new
   tools couldn't execute it otherwise.

 - It now uses -d for checking for the existence
   of the Xcode specs directory.

 - The call to sudo.bash has been dropped since cov
   and prof aren't bundled with the binary
   distributions.

Fixes #3455.

Tested on 10.5.8, 10.6.0, 10.6.8 and 10.7.3.

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

13 years agocmd/gc: fix addresses escaping through closures called in-place.
Luuk van Dijk [Mon, 23 Apr 2012 19:39:01 +0000 (15:39 -0400)]
cmd/gc: fix addresses escaping through closures called in-place.

Fixes #3545.

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

13 years agonet/http: lex cleanup
Pascal S. de Kloe [Mon, 23 Apr 2012 17:26:10 +0000 (10:26 -0700)]
net/http: lex cleanup

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

13 years agomath: ARM assembly implementation for Abs
Shenghou Ma [Mon, 23 Apr 2012 15:47:36 +0000 (23:47 +0800)]
math: ARM assembly implementation for Abs

Obtained on 700MHz OMAP4460:
benchmark       old ns/op    new ns/op    delta
BenchmarkAbs           61           23  -61.63%

R=dave, remyoudompheng, mtj, rsc
CC=golang-dev
https://golang.org/cl/6094047

13 years agotext/template: detect unexported fields better
Rob Pike [Mon, 23 Apr 2012 05:39:02 +0000 (15:39 +1000)]
text/template: detect unexported fields better
Moves the error detection back into execution, where it used to be,
and improves the error message.
Rolls back most of 6009048, which broke lower-case keys in maps.
If it weren't for maps we could detect this at compile time rather than
execution time.

Fixes #3542.

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

13 years agoreflect: document and test TypeOf(nil)
Rob Pike [Mon, 23 Apr 2012 02:07:02 +0000 (12:07 +1000)]
reflect: document and test TypeOf(nil)
Fixes #3549.

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

13 years agoexp/html: add more cases to inBodyIM
Andrew Balholm [Sun, 22 Apr 2012 06:19:21 +0000 (16:19 +1000)]
exp/html: add more cases to inBodyIM

Don't set framesetOK to false for hidden input elements.

Handle <param>, <source>, <track>, <textarea>, <iframe>, <noembed>,
and <noscript>

Pass 7 additional tests.

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

13 years agostrconv: 2x-4x speed improvement for atof64.
Rémy Oudompheng [Sat, 21 Apr 2012 11:56:51 +0000 (13:56 +0200)]
strconv: 2x-4x speed improvement for atof64.

benchmark                      old ns/op    new ns/op    delta
BenchmarkAtof64Decimal               344           71  -79.22%
BenchmarkAtof64Float                 397           90  -77.15%
BenchmarkAtof64FloatExp              445          241  -45.84%
BenchmarkAtof64Big                   731          324  -55.68%
BenchmarkAtof64RandomBits            761          453  -40.47%
BenchmarkAtof64RandomFloats          690          314  -54.49%

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

13 years agocompress/zlib: minor fixes
Quan Yong Zhai [Sat, 21 Apr 2012 04:34:42 +0000 (14:34 +1000)]
compress/zlib: minor fixes

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

13 years agoruntime: add benchmark for complex128 division
Michael Chaten [Sat, 21 Apr 2012 03:24:41 +0000 (13:24 +1000)]
runtime: add benchmark for complex128 division

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

13 years agonet: fix race between Close and Read
Dave Cheney [Sat, 21 Apr 2012 00:01:32 +0000 (10:01 +1000)]
net: fix race between Close and Read

Fixes #3507.

Applied the suggested fix from rsc. If the connection
is in closing state then errClosing will bubble up to
the caller.

The fix has been applied to udp, ip and unix as well as
their code path include nil'ing c.fd on close. Func
tests are available in the linked issue that verified
the bug existed there as well.

R=rsc, fullung, alex.brainman, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/6002053

13 years agoexp/html: more work on inBodyIM
Andrew Balholm [Fri, 20 Apr 2012 23:20:38 +0000 (09:20 +1000)]
exp/html: more work on inBodyIM

Reorder some cases.
Handle <pre>, <listing>, </form>, </li>, </dd>, </dt>, </h1>, </h2>,
</h3>, </h4>, </h5>, and </h6> tags.

Pass 6 additional tests.

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

13 years agoruntime: disable memory profiler in gc_test
Ian Lance Taylor [Fri, 20 Apr 2012 18:36:06 +0000 (11:36 -0700)]
runtime: disable memory profiler in gc_test

This lets the test pass on PPC64 GNU/Linux, which uses a much
larger page size and thus uses more memory to hold blocks
allocated for memory profiling.

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

13 years agonet/http/httputil: Made reverseproxy test less flaky.
Colby Ranger [Fri, 20 Apr 2012 16:31:23 +0000 (09:31 -0700)]
net/http/httputil: Made reverseproxy test less flaky.

The reverseproxy test depended on the behavior of
runtime.NumGoroutines(), which makes no guarantee when
goroutines are reaped. Instead, modify the flushLoop()
to invoke a callback when it returns, so the exit
from the loop can be tested, instead of the number
of gorountines running.

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

13 years agotest: use testlib in a few more cases (part 2)
Shenghou Ma [Fri, 20 Apr 2012 15:45:43 +0000 (23:45 +0800)]
test: use testlib in a few more cases (part 2)
        Introduced "runoutput" cmd for running generated program

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

13 years agodoc: don't wrap package names in directory listing
Andrew Gerrand [Fri, 20 Apr 2012 14:04:13 +0000 (10:04 -0400)]
doc: don't wrap package names in directory listing

Fixes #3522.

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

13 years agoexp/html: start making inBodyIM match the spec
Andrew Balholm [Fri, 20 Apr 2012 05:48:13 +0000 (15:48 +1000)]
exp/html: start making inBodyIM match the spec

Reorder some start tags.

Improve handling of </body>.
Handle </html>.

Pass 2 additional tests (by handling </html>).

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

13 years agoexp/html: ignore null bytes in text
Andrew Balholm [Fri, 20 Apr 2012 04:25:42 +0000 (14:25 +1000)]
exp/html: ignore null bytes in text

pass one additional test

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

13 years agoexp/html: improve afterHeadIM
Andrew Balholm [Fri, 20 Apr 2012 00:48:10 +0000 (10:48 +1000)]
exp/html: improve afterHeadIM

Clean up the flow of control.
Fix the TODO for handling <html> tags.
Add a case to ignore doctype declarations.

Pass one additional test.

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

13 years agosyscall: cleanly exit all Go procs on Plan 9
Akshat Kumar [Thu, 19 Apr 2012 23:31:26 +0000 (16:31 -0700)]
syscall: cleanly exit all Go procs on Plan 9

syscall.Exit would originally kill only the calling
Go proc, leaving behind other procs in the
same group. This change makes syscall.Exit call
runtime·exit, which due to CL
https://golang.org/cl/5617048
will cleanly exit all the Go procs in the group.

R=golang-dev, rsc, rminnich, remyoudompheng, ality, john
CC=golang-dev, mirtchovski
https://golang.org/cl/6036051

13 years agoexp/html: improve InHeadIM
Andrew Balholm [Thu, 19 Apr 2012 23:08:58 +0000 (09:08 +1000)]
exp/html: improve InHeadIM

Clean up the flow of control, and add a case for doctype tokens (to
ignore them).

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

13 years agonet/http: add example for FileServer to mention StripPrefix
Shenghou Ma [Thu, 19 Apr 2012 16:41:10 +0000 (00:41 +0800)]
net/http: add example for FileServer to mention StripPrefix
        Fixes #3530.

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

13 years agoA+C: add Bjorn Tillenius (Individual CLA)
Brad Fitzpatrick [Thu, 19 Apr 2012 16:23:48 +0000 (09:23 -0700)]
A+C: add Bjorn Tillenius (Individual CLA)

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

13 years agoA+C: Add Michael Chaten (Individual CLA)
Brad Fitzpatrick [Thu, 19 Apr 2012 16:18:49 +0000 (09:18 -0700)]
A+C: Add Michael Chaten (Individual CLA)

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

13 years agoexp/html: add parseImpliedToken method to parser
Andrew Balholm [Thu, 19 Apr 2012 01:48:17 +0000 (11:48 +1000)]
exp/html: add parseImpliedToken method to parser

This method will allow us to be explicit about what we're doing when
we insert an implied token, and avoid repeating the logic involved in
multiple places.

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

13 years agodoc/articles/image_draw.html: Change ColorImage to Uniform
Benny Siegert [Thu, 19 Apr 2012 01:04:42 +0000 (11:04 +1000)]
doc/articles/image_draw.html: Change ColorImage to Uniform

Fixes #3474.

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

13 years agonet/http/httputil: Clean up ReverseProxy maxLatencyWriter goroutines.
Colby Ranger [Wed, 18 Apr 2012 18:33:02 +0000 (11:33 -0700)]
net/http/httputil: Clean up ReverseProxy maxLatencyWriter goroutines.

When FlushInterval is specified on ReverseProxy, the ResponseWriter is
wrapped with a maxLatencyWriter that periodically flushes in a
goroutine. That goroutine was not being cleaned up at the end of the
request. This resulted in a panic when Flush() was being called on a
ResponseWriter that was closed.

The code was updated to always send the done message to the flushLoop()
goroutine after copying the body. Futhermore, the code was refactored to
allow the test to verify the maxLatencyWriter behavior.

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

13 years agoencoding/asn1: allow lengths up to the maximum int value.
Adam Langley [Wed, 18 Apr 2012 17:41:11 +0000 (13:41 -0400)]
encoding/asn1: allow lengths up to the maximum int value.

Previously we capped lengths at 2**24 rather than 2**31.

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

13 years agoexp/html: improve beforeHeadIM
Andrew Balholm [Wed, 18 Apr 2012 12:45:36 +0000 (22:45 +1000)]
exp/html: improve beforeHeadIM

Add a case to ignore doctype tokens.

Clean up the flow of control to more clearly match the spec.

Pass one more test.

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

13 years agoexp/html: adjust beforeHTMLIM to match spec
Andrew Balholm [Wed, 18 Apr 2012 03:26:35 +0000 (13:26 +1000)]
exp/html: adjust beforeHTMLIM to match spec

Add case for doctype tokens (which are ignored).

This CL does not change the status of any tests.

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

13 years agoos/user: simplify test
Brad Fitzpatrick [Wed, 18 Apr 2012 01:46:35 +0000 (18:46 -0700)]
os/user: simplify test

Don't require the home directory to exist. Just check
that it returns something.

Fixes #3531

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

13 years agolib9: fix warning under clang 3.1
Dave Cheney [Tue, 17 Apr 2012 23:57:00 +0000 (09:57 +1000)]
lib9: fix warning under clang 3.1

Fixes #3534.

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

13 years agocodereview: restore help messages
Anthony Martin [Tue, 17 Apr 2012 22:51:05 +0000 (15:51 -0700)]
codereview: restore help messages

Docstrings were not being set for the wrapper
functions returned by the hgcommand decorator.

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

13 years agoexp/html: more comprehensive tests
Andrew Balholm [Tue, 17 Apr 2012 07:17:22 +0000 (17:17 +1000)]
exp/html: more comprehensive tests

Currently, the html package only runs a limited subset of the tests
in the testdata directory. This tends to limit development of the
parser to fixing the bug that causes the first failing test.

This CL gives it the ability to run all the tests and produce a
log showing the status of each test. (It does it when tests are run with
'go test --update-logs') The status is listed as PASS, FAIL, or PARSE
(PARSE means that parsing produced the correct tree, but rendering and
re-parsing does not produce the same tree).

When 'go test' is run without --update-logs, it runs the tests marked
'PASS' in the logs (and the parsing portion of the tests marked 'PARSE').
Thus it will fail if there has been a regression since the last
time the logs were updated.

My goal for this CL is to allow develoment of the html package to
be less test-driven, while still having the advantages of regression
tests. In other words, one can work on any portion of the parser
and quickly see whether he is breaking things or improving them.

Current statistics of the tests:
$ grep ^PASS *.log|wc -l
        1017
$ grep ^PARSE *.log|wc -l
          46
$ grep ^FAIL *.log|wc -l
         181

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

13 years agoflag: update style.
David Symonds [Tue, 17 Apr 2012 06:37:35 +0000 (16:37 +1000)]
flag: update style.

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

13 years agocmd/prof: don't build on Plan 9 for now.
Anthony Martin [Tue, 17 Apr 2012 00:36:36 +0000 (17:36 -0700)]
cmd/prof: don't build on Plan 9 for now.

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

13 years agoos: avoid panic when testing errors on Plan 9
Anthony Martin [Tue, 17 Apr 2012 00:36:02 +0000 (17:36 -0700)]
os: avoid panic when testing errors on Plan 9

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

13 years agosyscall: fix duplicate fd bug for Plan 9
Akshat Kumar [Tue, 17 Apr 2012 00:35:15 +0000 (17:35 -0700)]
syscall: fix duplicate fd bug for Plan 9

This change comes from CL 5536043,
created by Andrey Mirtchovski. His
description follows:

"The plan9 exec child handler does not manage
dup-ed fds from the parent correctly: when a
dup-ed file descriptor appears in the child's fd
list it is closed when first encountered and then
subsequent attempt to dup it later in Pass 2 fails,
resulting in 'fork/exec: fd out of range or not
open'."

R=golang-dev, rminnich, ality
CC=golang-dev, mirtchovski, rsc
https://golang.org/cl/6009046

13 years agoCONTRIBUTORS: add Colby Ranger (Google CLA)
Brad Fitzpatrick [Mon, 16 Apr 2012 17:25:20 +0000 (10:25 -0700)]
CONTRIBUTORS: add Colby Ranger (Google CLA)

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

13 years agodoc/code: mention $GOBIN
Shenghou Ma [Mon, 16 Apr 2012 16:41:27 +0000 (02:41 +1000)]
doc/code: mention $GOBIN

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

13 years agoruntime: update defs for openbsd
Joel Sing [Mon, 16 Apr 2012 16:35:41 +0000 (02:35 +1000)]
runtime: update defs for openbsd

Update runtime defs for openbsd. Add struct __tfork, which will be
needed by an upcoming change.

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

13 years agotime: parse fractional second with single digit
Robert Hencke [Mon, 16 Apr 2012 01:56:37 +0000 (11:56 +1000)]
time: parse fractional second with single digit

Fixes #3487.

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

13 years agotext/template/parse: fix doc comment
Shenghou Ma [Sun, 15 Apr 2012 13:50:21 +0000 (21:50 +0800)]
text/template/parse: fix doc comment
    Fixes #3529.

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

13 years agostrconv: make malloc tests more reliable
Dave Cheney [Sat, 14 Apr 2012 11:34:08 +0000 (21:34 +1000)]
strconv: make malloc tests more reliable

Fixes #3495.

I adapted fmt.TestCountMallocs to fix the
existing tests. As the resulting tests did not
appear to belong to either itoa or ftoa I moved
them into their own file.

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

13 years agodoc: update Mercurial installation instructions
Andrew Gerrand [Sat, 14 Apr 2012 03:27:11 +0000 (13:27 +1000)]
doc: update Mercurial installation instructions

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

13 years agocmd/6g: restore magic multiply for /=, %=.
Rémy Oudompheng [Fri, 13 Apr 2012 08:12:31 +0000 (10:12 +0200)]
cmd/6g: restore magic multiply for /=, %=.

Also enables turning /= 2 in a right shift.

Part of issue 2230.

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