]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agospec: rune is now an alias for int32
Russ Cox [Fri, 9 Dec 2011 05:11:43 +0000 (00:11 -0500)]
spec: rune is now an alias for int32

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

13 years agoexp/types: fix linux build
Russ Cox [Fri, 9 Dec 2011 04:20:21 +0000 (23:20 -0500)]
exp/types: fix linux build

I don't understand why it was only broken on Linux

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

13 years agogc: fix export of '\'' and '\\' constants
Russ Cox [Fri, 9 Dec 2011 03:43:31 +0000 (22:43 -0500)]
gc: fix export of '\'' and '\\' constants

Fixes Windows build.

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

13 years agospec: fix typo in example comment
Charles L. Dorian [Fri, 9 Dec 2011 03:27:14 +0000 (22:27 -0500)]
spec: fix typo in example comment

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

13 years agoupdate tree for new default type rule
Russ Cox [Fri, 9 Dec 2011 03:08:03 +0000 (22:08 -0500)]
update tree for new default type rule

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

13 years agogc: implement character constant type rules
Russ Cox [Fri, 9 Dec 2011 03:07:43 +0000 (22:07 -0500)]
gc: implement character constant type rules

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

13 years agomath: special cases for Pow10; delete BUG
Charles L. Dorian [Fri, 9 Dec 2011 03:06:33 +0000 (22:06 -0500)]
math: special cases for Pow10; delete BUG

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

13 years agospec: var x = 'a' defaults to type rune
Russ Cox [Fri, 9 Dec 2011 02:48:19 +0000 (21:48 -0500)]
spec: var x = 'a' defaults to type rune

R=gri, r, r, adg, iant, ken
CC=golang-dev
https://golang.org/cl/5444053

13 years agodoc/go1: most of the simple language changes
Rob Pike [Fri, 9 Dec 2011 00:39:05 +0000 (16:39 -0800)]
doc/go1: most of the simple language changes

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

13 years agosyscall: allow for mksyscall_windows.pl to be used outside of syscall
Alex Brainman [Fri, 9 Dec 2011 00:12:03 +0000 (11:12 +1100)]
syscall: allow for mksyscall_windows.pl to be used outside of syscall

this change should have been part of fafcd328da73

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

13 years agomisc/cgo/testso: do not leave out file behind
Alex Brainman [Fri, 9 Dec 2011 00:00:49 +0000 (11:00 +1100)]
misc/cgo/testso: do not leave out file behind

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

13 years agosyscall: Remove obsolete Errstr call from commented-out example.
Benny Siegert [Thu, 8 Dec 2011 23:42:34 +0000 (10:42 +1100)]
syscall: Remove obsolete Errstr call from commented-out example.

syscall_windows.go contains a small demo, which calls the obsolete
syscall.Errstr function.

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

13 years agomath: document more special cases
Charles L. Dorian [Thu, 8 Dec 2011 22:07:13 +0000 (17:07 -0500)]
math: document more special cases

Acosh, Asinh, Atanh, Ceil, Floor, Trunc, Mod and Remainder affected. These changes add some non-finite arguments and results (and -0.0 results).

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

13 years agocrypto/dsa: don't truncate input hashes.
Adam Langley [Thu, 8 Dec 2011 21:46:19 +0000 (16:46 -0500)]
crypto/dsa: don't truncate input hashes.

Although FIPS 186-3 says that we should truncate the hashes, at least
one other library (libgcrypt) doesn't. This means that it's impossible
to interoperate with code using gcrypt if we enforce the truncation
inside of crypto/dsa.

This change shouldn't actually affect anything because nearly
everybody pairs DSA with SHA1, which doesn't need to be truncated in
either case.

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

13 years agodoc/go1: document rearranged package hierarchy
Rob Pike [Thu, 8 Dec 2011 19:35:28 +0000 (11:35 -0800)]
doc/go1: document rearranged package hierarchy
Some exciting HTML and CSS here.

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

13 years agotmpltohtml: put a DO NOT EDIT mark automatically in the output
Rob Pike [Thu, 8 Dec 2011 19:26:49 +0000 (11:26 -0800)]
tmpltohtml: put a DO NOT EDIT mark automatically in the output

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

13 years agohtml/template: clean up locking for ExecuteTemplate
Rob Pike [Thu, 8 Dec 2011 18:15:53 +0000 (10:15 -0800)]
html/template: clean up locking for ExecuteTemplate

R=mikesamuel, rogpeppe
CC=golang-dev
https://golang.org/cl/5448137

13 years agosyscall: add constants for flock() system call under Linux.
Andrea Spadaccini [Thu, 8 Dec 2011 06:12:08 +0000 (15:12 +0900)]
syscall: add constants for flock() system call under Linux.

The values have been generated only for the i386 and amd64 architectures.

R=golang-dev, mikioh.mikioh, dsymonds
CC=bradfitz, dsymonds, golang-dev
https://golang.org/cl/5452060

13 years agoCONTRIBUTORS: Andrea Spadaccini (Google CLA)
David Symonds [Thu, 8 Dec 2011 05:53:39 +0000 (16:53 +1100)]
CONTRIBUTORS: Andrea Spadaccini (Google CLA)

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

13 years agotime: use Duration for AfterFunc.
David Symonds [Thu, 8 Dec 2011 04:42:44 +0000 (15:42 +1100)]
time: use Duration for AfterFunc.

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

13 years agogc: rename %union field name from lint to i
Russ Cox [Thu, 8 Dec 2011 04:38:32 +0000 (23:38 -0500)]
gc: rename %union field name from lint to i

#define lint has special meaning to Bison;
having a field named lint conflicts with that.

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

13 years agosyscall: return error, not uintptr, when function returns error
Alex Brainman [Thu, 8 Dec 2011 01:07:21 +0000 (12:07 +1100)]
syscall: return error, not uintptr, when function returns error

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

13 years agodoc/go1: map deletion
Rob Pike [Thu, 8 Dec 2011 00:11:17 +0000 (16:11 -0800)]
doc/go1: map deletion
This CL is in part a proposal for how to write these sections:
- Brief discussion of change
- No attempt to analyze the thinking about it
- Old code
- New code, runnable if possible
- How to update old programs

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

13 years agogobuilder: goinstall packages after building go tree
Andrew Gerrand [Wed, 7 Dec 2011 23:31:06 +0000 (10:31 +1100)]
gobuilder: goinstall packages after building go tree

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

13 years agostrconv: fix documentation
Robert Griesemer [Wed, 7 Dec 2011 22:45:45 +0000 (14:45 -0800)]
strconv: fix documentation

Also: minor performance fix for large precision results.

benchmark                                   old ns/op    new ns/op    delta
strconv_test.BenchmarkFormatFloatDecimal         2734         2734   +0.00%
strconv_test.BenchmarkFormatFloat                3141         3139   -0.06%
strconv_test.BenchmarkFormatFloatExp             8970         8989   +0.21%
strconv_test.BenchmarkFormatFloatBig             3228         3208   -0.62%

Fixes #2535.

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

13 years agodoc: skeleton for release note document
Rob Pike [Wed, 7 Dec 2011 22:33:37 +0000 (14:33 -0800)]
doc: skeleton for release note document
No content yet other than titles and an introductory paragraph.
Once this is in, content can arise as separate manageable CLs.

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

13 years agogc: keep pointer to original node in constant rewrites.
Rémy Oudompheng [Wed, 7 Dec 2011 21:18:50 +0000 (16:18 -0500)]
gc: keep pointer to original node in constant rewrites.

This allows printing meaningful expressions in error messages
instead of evaluated constants.
Fixes #2276.

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

13 years agoexp/sql: simplify some string conversions.
David Symonds [Wed, 7 Dec 2011 21:08:00 +0000 (08:08 +1100)]
exp/sql: simplify some string conversions.

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

13 years agogc: fix spurious typecheck loop in &composite literal
Russ Cox [Wed, 7 Dec 2011 20:48:55 +0000 (15:48 -0500)]
gc: fix spurious typecheck loop in &composite literal

Fixes #2538.

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

13 years agobytes: lost edit from earlier CL
Russ Cox [Wed, 7 Dec 2011 20:30:01 +0000 (15:30 -0500)]
bytes: lost edit from earlier CL

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

13 years agobytes: faster Count, Index, Equal
Russ Cox [Wed, 7 Dec 2011 20:09:56 +0000 (15:09 -0500)]
bytes: faster Count, Index, Equal

Benchmarks are from GOARCH=amd64 on a MacPro5,1.

benchmark                                    old MB/s     new MB/s  speedup
bytes_test.BenchmarkEqual32                    452.89       891.07    1.97x
bytes_test.BenchmarkEqual4K                    852.71      1700.44    1.99x
bytes_test.BenchmarkEqual4M                    841.53      1587.93    1.89x
bytes_test.BenchmarkEqual64M                   838.22      1578.14    1.88x

bytes_test.BenchmarkIndex32                     58.02        48.99    0.84x
bytes_test.BenchmarkIndex4K                     48.26        41.32    0.86x
bytes_test.BenchmarkIndex4M                     48.20        41.24    0.86x
bytes_test.BenchmarkIndex64M                    48.08        41.21    0.86x
bytes_test.BenchmarkIndexEasy32                410.04       546.82    1.33x
bytes_test.BenchmarkIndexEasy4K                849.26     14257.37   16.79x
bytes_test.BenchmarkIndexEasy4M                854.54     17222.15   20.15x
bytes_test.BenchmarkIndexEasy64M               843.57     11060.40   13.11x

bytes_test.BenchmarkCount32                     57.24        50.68    0.89x
bytes_test.BenchmarkCount4K                     48.19        41.82    0.87x
bytes_test.BenchmarkCount4M                     48.18        41.74    0.87x
bytes_test.BenchmarkCount64M                    48.17        41.71    0.87x
bytes_test.BenchmarkCountEasy32                433.11       547.44    1.26x
bytes_test.BenchmarkCountEasy4K               1130.59     14194.06   12.55x
bytes_test.BenchmarkCountEasy4M               1131.23     17231.18   15.23x
bytes_test.BenchmarkCountEasy64M              1111.40     11068.88    9.96x

The non-easy Count/Index benchmarks are a worst case input.

regexp.BenchmarkMatchEasy0_32                  237.46       221.47    0.93x
regexp.BenchmarkMatchEasy0_1K                  553.53      1019.72    1.84x
regexp.BenchmarkMatchEasy0_32K                 693.99      1672.06    2.41x
regexp.BenchmarkMatchEasy0_1M                  688.72      1611.68    2.34x
regexp.BenchmarkMatchEasy0_32M                 680.70      1565.05    2.30x
regexp.BenchmarkMatchEasy1_32                  165.56       243.08    1.47x
regexp.BenchmarkMatchEasy1_1K                  336.45       496.32    1.48x
regexp.BenchmarkMatchEasy1_32K                 302.80       425.63    1.41x
regexp.BenchmarkMatchEasy1_1M                  300.42       414.20    1.38x
regexp.BenchmarkMatchEasy1_32M                 299.64       413.47    1.38x

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

13 years agoregexp: avoid allocation of input interface
Russ Cox [Wed, 7 Dec 2011 20:03:05 +0000 (15:03 -0500)]
regexp: avoid allocation of input interface

Matters most for small inputs, because there is no real work
to amortize the allocation effort against.

benchmark                                old ns/op    new ns/op    delta
BenchmarkLiteral                               613          473  -22.84%
BenchmarkNotLiteral                           4981         4931   -1.00%
BenchmarkMatchClass                           7289         7122   -2.29%
BenchmarkMatchClass_InRange                   6618         6663   +0.68%
BenchmarkReplaceAll                           7843         7233   -7.78%
BenchmarkAnchoredLiteralShortNonMatch          329          228  -30.70%
BenchmarkAnchoredLiteralLongNonMatch           322          228  -29.19%
BenchmarkAnchoredShortMatch                    838          715  -14.68%
BenchmarkAnchoredLongMatch                     824          715  -13.23%

benchmark                                 old MB/s     new MB/s  speedup
BenchmarkMatchEasy0_32                      119.73       196.61    1.64x
BenchmarkMatchEasy0_1K                      540.58       538.33    1.00x
BenchmarkMatchEasy0_32K                     732.57       714.00    0.97x
BenchmarkMatchEasy0_1M                      726.44       708.36    0.98x
BenchmarkMatchEasy0_32M                     707.77       691.45    0.98x
BenchmarkMatchEasy1_32                      102.12       136.11    1.33x
BenchmarkMatchEasy1_1K                      298.31       307.04    1.03x
BenchmarkMatchEasy1_32K                     273.56       274.43    1.00x
BenchmarkMatchEasy1_1M                      268.42       269.23    1.00x
BenchmarkMatchEasy1_32M                     266.15       267.34    1.00x
BenchmarkMatchMedium_32                       2.53         3.38    1.34x
BenchmarkMatchMedium_1K                       9.37         9.57    1.02x
BenchmarkMatchMedium_32K                      9.29         9.67    1.04x
BenchmarkMatchMedium_1M                       9.42         9.66    1.03x
BenchmarkMatchMedium_32M                      9.41         9.62    1.02x
BenchmarkMatchHard_32                         6.66         6.75    1.01x
BenchmarkMatchHard_1K                         6.81         6.85    1.01x
BenchmarkMatchHard_32K                        6.79         6.85    1.01x
BenchmarkMatchHard_1M                         6.82         6.83    1.00x
BenchmarkMatchHard_32M                        6.80         6.80    1.00x

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

13 years agotest: make array smaller in nilptr test
Russ Cox [Wed, 7 Dec 2011 20:00:44 +0000 (15:00 -0500)]
test: make array smaller in nilptr test

Fixes #2314.

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

13 years agogodoc: <pre> must not occur inside <p>
Olivier Duperray [Wed, 7 Dec 2011 20:00:38 +0000 (15:00 -0500)]
godoc: <pre> must not occur inside <p>
Fixes #2532

R=golang-dev, dr.volker.dobler, rsc
CC=golang-dev
https://golang.org/cl/5450115

13 years agoA+C: Olivier Duperray, Taru Karttunen (individual CLA)
Russ Cox [Wed, 7 Dec 2011 20:00:32 +0000 (15:00 -0500)]
A+C: Olivier Duperray, Taru Karttunen (individual CLA)

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

13 years agomath: document special-cases behavior for Dim, Max and Min
Charles L. Dorian [Wed, 7 Dec 2011 19:52:17 +0000 (14:52 -0500)]
math: document special-cases behavior for Dim, Max and Min

Max returns +Inf if x or y is +Inf; else it returns NaN if either x or y is NaN. Max(-0, -0) returns -0.
Min returns -Inf if x or y is -Inf; else it returns NaN if either x or y is NaN. Min(+0, -0) returns -0.
Dim(+Inf, +Inf) = NaN, Dim(-Inf, -Inf) = NaN and Dim(NaN, anything) = NaN.
Also, change "conditions" to "cases" for Sin (missed it in previous CL).

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

13 years agotime: fix daysIn for December
Peter Mundy [Wed, 7 Dec 2011 19:47:25 +0000 (14:47 -0500)]
time: fix daysIn for December

daysBefore[12+1]: index out of range
time.December and Windows SYSTEMTIME.wMonth
are 12 for December.

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

13 years agostrconv: faster float conversion
Robert Griesemer [Wed, 7 Dec 2011 18:30:27 +0000 (10:30 -0800)]
strconv: faster float conversion

- added AppendFloatX benchmarks
- 2% to 13% better performance
- check for illegal bitSize

benchmark                                   old ns/op    new ns/op    delta
strconv_test.BenchmarkFormatFloatDecimal         2993         2733   -8.69%
strconv_test.BenchmarkFormatFloat                3384         3141   -7.18%
strconv_test.BenchmarkFormatFloatExp             9192         9010   -1.98%
strconv_test.BenchmarkFormatFloatBig             3279         3207   -2.20%
strconv_test.BenchmarkAppendFloatDecimal         2837         2478  -12.65%
strconv_test.BenchmarkAppendFloat                3196         2928   -8.39%
strconv_test.BenchmarkAppendFloatExp             9028         8773   -2.82%
strconv_test.BenchmarkAppendFloatBig             3151         2782  -11.71%

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

13 years agomisc/benchcmp: don't require "Benchmark" at beginning of line
Robert Griesemer [Wed, 7 Dec 2011 18:30:08 +0000 (10:30 -0800)]
misc/benchcmp: don't require "Benchmark" at beginning of line

Output is package_name.BenchmarkXXX.

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

13 years agold: fix memory leaks
Scott Lawrence [Wed, 7 Dec 2011 16:50:39 +0000 (11:50 -0500)]
ld: fix memory leaks

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

13 years agogc: more accurate description of -w and -W switches.
Rémy Oudompheng [Wed, 7 Dec 2011 16:45:30 +0000 (11:45 -0500)]
gc: more accurate description of -w and -W switches.

The -w switch actually prints steps of the syntax tree walks
while -W prints a summary before and after the walk.

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

13 years agoexp/ssh: Have Wait() return an *ExitError
Gustav Paul [Wed, 7 Dec 2011 14:58:22 +0000 (09:58 -0500)]
exp/ssh: Have Wait() return an *ExitError

I added the clientChan's msg channel to the list of channels that are closed in mainloop when the server sends a channelCloseMsg.

I added an ExitError type that wraps a Waitmsg similar to that of os/exec. I fill ExitStatus with the data returned in the 'exit-status' channel message and Msg with the data returned in the 'exit-signal' channel message.

Instead of having Wait() return on the first 'exit-status'/'exit-signal' I have it return an ExitError containing the status and signal when the clientChan's msg channel is closed.

I added two tests cases to session_test.go that test for exit status 0 (in which case Wait() returns nil) and exit status 1 (in which case Wait() returns an ExitError with ExitStatus 1)

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

13 years agold: increase default stack size on Windows for cgo
Dmitriy Vyukov [Wed, 7 Dec 2011 13:53:17 +0000 (16:53 +0300)]
ld: increase default stack size on Windows for cgo
Fixes #2437.

R=rsc, hectorchu, mattn.jp, alex.brainman, jdpoirier, snaury, n13m3y3r
CC=golang-dev
https://golang.org/cl/5371049

13 years agotag weekly.2011-12-06
Andrew Gerrand [Wed, 7 Dec 2011 02:38:12 +0000 (13:38 +1100)]
tag weekly.2011-12-06

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

13 years agodoc: fix weekly.2011-12-06 release notes typo weekly.2011-12-06
Andrew Gerrand [Wed, 7 Dec 2011 02:33:59 +0000 (13:33 +1100)]
doc: fix weekly.2011-12-06 release notes typo

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

13 years agotag weekly.2011-12-06
Andrew Gerrand [Wed, 7 Dec 2011 02:16:02 +0000 (13:16 +1100)]
tag weekly.2011-12-06

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

13 years agoweekly.2011-12-06
Andrew Gerrand [Wed, 7 Dec 2011 02:15:10 +0000 (13:15 +1100)]
weekly.2011-12-06

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

13 years agohttp: make Transport warning about connections closing more accurate
Brad Fitzpatrick [Wed, 7 Dec 2011 00:38:02 +0000 (16:38 -0800)]
http: make Transport warning about connections closing more accurate

It was fragile and non-portable, and then became spammy with
the os.EINVAL removal.  Now it just uses the length of the
Peek return value instead.

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

13 years agocrypto: allocate less.
Adam Langley [Tue, 6 Dec 2011 23:25:14 +0000 (18:25 -0500)]
crypto: allocate less.

The code in hash functions themselves could write directly into the
output buffer for a savings of about 50ns. But it's a little ugly so I
wasted a copy.

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

13 years agoexp/ssh: cleanup client auth tests
Dave Cheney [Tue, 6 Dec 2011 23:13:20 +0000 (18:13 -0500)]
exp/ssh: cleanup client auth tests

This CL cleans up the client auth tests, making the
individual test body more manageable.

Also, adds tests for rsa and dsa key negotiation.

Finally, remove the package level use of the variable
strings, which avoids conflicting with the strings pkg.

R=gustav.paul, agl, n13m3y3r, rsc
CC=golang-dev
https://golang.org/cl/5447049

13 years agogoinstall: honour -install=false flag when -make=true
Andrew Gerrand [Tue, 6 Dec 2011 22:41:20 +0000 (09:41 +1100)]
goinstall: honour -install=false flag when -make=true

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

13 years agostrconv: squeezed a bit more out of int/uint formatting
Robert Griesemer [Tue, 6 Dec 2011 21:54:22 +0000 (13:54 -0800)]
strconv: squeezed a bit more out of int/uint formatting

- less code
- slightly better performance (0-4%)

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

13 years agocrypto/x509: if a parent cert has a raw subject, use it.
Adam Langley [Tue, 6 Dec 2011 21:42:48 +0000 (16:42 -0500)]
crypto/x509: if a parent cert has a raw subject, use it.

This avoids a problem when creating certificates with parents that
were produce by other code: the Go structures don't contain all the
information about the various ASN.1 string types etc and so that
information would otherwise be lost.

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

13 years agohtml/template: simplify ExecuteTemplate a little
Rob Pike [Tue, 6 Dec 2011 20:47:12 +0000 (12:47 -0800)]
html/template: simplify ExecuteTemplate a little
Allow the text template to handle the error case of no template
with the given name.
Simplification suggested by Mike Samuel.

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

13 years agofmt: benchmark floating point.
Rob Pike [Tue, 6 Dec 2011 16:40:16 +0000 (08:40 -0800)]
fmt: benchmark floating point.
mallocs per Sprintf("%x"): 1
mallocs per Sprintf("%g"): 4

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

13 years agocgo: fix typo in the documentation
Maxim Pimenov [Tue, 6 Dec 2011 16:16:39 +0000 (08:16 -0800)]
cgo: fix typo in the documentation

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

13 years agostrconv: 34% to 63% faster conversions
Robert Griesemer [Tue, 6 Dec 2011 16:15:45 +0000 (08:15 -0800)]
strconv: 34% to 63% faster conversions

(Note that the Int and Uint benchmarks use different test sets
and thus cannot be compared against each other. Int and Uint
conversions are approximately the same speed).

Before (best of 3 runs):
strconv_test.BenchmarkFormatInt    100000    15636 ns/op
strconv_test.BenchmarkAppendInt    100000    18930 ns/op
strconv_test.BenchmarkFormatUint   500000     4392 ns/op
strconv_test.BenchmarkAppendUint   500000     5152 ns/op

After (best of 3 runs):

strconv_test.BenchmarkFormatInt    200000    10070 ns/op (-36%)
strconv_test.BenchmarkAppendInt    200000     7097 ns/op (-63%)
strconv_test.BenchmarkFormatUint  1000000     2893 ns/op (-34%)
strconv_test.BenchmarkAppendUint   500000     2462 ns/op (-52%)

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

13 years agogc: disallow map/func equality via interface comparison
Russ Cox [Tue, 6 Dec 2011 15:48:17 +0000 (10:48 -0500)]
gc: disallow map/func equality via interface comparison

Missed when I removed direct map/func equality.

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

13 years agoimage: avoid func comparison during ColorModel comparison
Russ Cox [Tue, 6 Dec 2011 15:47:42 +0000 (10:47 -0500)]
image: avoid func comparison during ColorModel comparison

When I disallowed map + func comparisons, I only did it
in the static case and missed the comparisons via == on
interface values.  Fixing that turned these up.

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

13 years agoexp/ssh: simplify client channel open logic
Dave Cheney [Tue, 6 Dec 2011 14:33:23 +0000 (09:33 -0500)]
exp/ssh: simplify client channel open logic

This is part one of a small set of CL's that aim to resolve
the outstanding TODOs relating to channel close and blocking
behavior.

Firstly, the hairy handling of assigning the peersId is now
done in one place. The cost of this change is the slightly
paradoxical construction of the partially created clientChan.

Secondly, by creating clientChan.stdin/out/err when the channel
is opened, the creation of consumers like tcpchan and Session
is simplified; they just have to wire themselves up to the
relevant readers/writers.

R=agl, gustav.paul, rsc
CC=golang-dev
https://golang.org/cl/5448073

13 years agovarious: we don't cast, we convert
Rob Pike [Tue, 6 Dec 2011 03:40:52 +0000 (19:40 -0800)]
various: we don't cast, we convert

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

13 years agohash: rewrite comment on Hash.Sum method
Andrew Gerrand [Tue, 6 Dec 2011 03:12:09 +0000 (14:12 +1100)]
hash: rewrite comment on Hash.Sum method

Fixes #2530.

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

13 years agofmt: only use Stringer or Error for strings
Rob Pike [Tue, 6 Dec 2011 00:45:51 +0000 (16:45 -0800)]
fmt: only use Stringer or Error for strings
This is a slight change to fmt's semantics, but means that if you use
%d to print an integer with a Stringable value, it will print as an integer.
This came up because Time.Month() couldn't cleanly print as an integer
rather than a name. Using %d on Stringables is silly anyway, so there
should be no effect outside the fmt tests.
As a mild bonus, certain recursive failures of String methods
will also be avoided this way.

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

13 years agogodoc: Show type examples between variables and methods.
Volker Dobler [Mon, 5 Dec 2011 23:52:43 +0000 (10:52 +1100)]
godoc: Show type examples between variables and methods.

Fixes #2466.

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

13 years agogofix: fix for strconv API change
Russ Cox [Mon, 5 Dec 2011 20:52:35 +0000 (15:52 -0500)]
gofix: fix for strconv API change

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

13 years agouse new strconv API
Russ Cox [Mon, 5 Dec 2011 20:48:46 +0000 (15:48 -0500)]
use new strconv API

All but 3 cases (in gcimporter.go and hixie.go)
are automatic conversions using gofix.

No attempt is made to use the new Append functions
even though there are definitely opportunities.

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

13 years agostrconv: new API
Russ Cox [Mon, 5 Dec 2011 20:48:21 +0000 (15:48 -0500)]
strconv: new API

R=golang-dev, bradfitz, gri, r, agl
CC=golang-dev
https://golang.org/cl/5434095

13 years agogc: changes in export format in preparation of inlining.
Luuk van Dijk [Mon, 5 Dec 2011 19:40:19 +0000 (14:40 -0500)]
gc: changes in export format in preparation of inlining.

Includes minimal change to gcimporter to keep it working,

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

13 years agogc: remove type elision in struct literals
Russ Cox [Mon, 5 Dec 2011 19:22:41 +0000 (14:22 -0500)]
gc: remove type elision in struct literals

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

13 years agospec: remove contentious composite literal shortening
Russ Cox [Mon, 5 Dec 2011 19:22:23 +0000 (14:22 -0500)]
spec: remove contentious composite literal shortening

R=gri, r, gustavo, r
CC=golang-dev
https://golang.org/cl/5451099

13 years agomath: add special-cases comments to Sinh and Tanh.
Charles L. Dorian [Mon, 5 Dec 2011 19:01:24 +0000 (14:01 -0500)]
math: add special-cases comments to Sinh and Tanh.

Also change "Special conditions" to "Special cases" as in other functions.

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

13 years agocrypto/aes: eliminate some bounds checking and manual truncation.
Rémy Oudompheng [Mon, 5 Dec 2011 18:30:25 +0000 (13:30 -0500)]
crypto/aes: eliminate some bounds checking and manual truncation.

By converting array indices to uint8, they are automatically
constrained in the array range, and the binary AND with 0xff
is no longer needed anymore.

Before:  aes.BenchmarkEncrypt    363 ns/op
After:   aes.BenchmarkEncrypt    273 ns/op

R=golang-dev, gri, agl
CC=golang-dev, remy
https://golang.org/cl/5450084

13 years agoruntime: prep for type-specific algorithms
Russ Cox [Mon, 5 Dec 2011 14:40:22 +0000 (09:40 -0500)]
runtime: prep for type-specific algorithms

Equality on structs will require arbitrary code for type equality,
so change algorithm in type data from uint8 to table pointer.
In the process, trim top-level map structure from
104/80 bytes (64-bit/32-bit) to 24/12.

Equality on structs will require being able to call code generated
by the Go compiler, and C code has no way to access Go return
values, so change the hash and equal algorithm functions to take
a pointer to a result instead of returning the result.

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

13 years agogobuilder: use new dashboard protocol
Andrew Gerrand [Mon, 5 Dec 2011 05:44:10 +0000 (16:44 +1100)]
gobuilder: use new dashboard protocol
gobuilder: -commit mode for packages
gobuilder: cripple -package mode temporarily

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

13 years agomisc/dashboard: init handler for bootstrapping
Andrew Gerrand [Mon, 5 Dec 2011 05:22:14 +0000 (16:22 +1100)]
misc/dashboard: init handler for bootstrapping
misc/dashboard: support unauthenticated GETs
misc/dashboard: add ?nukeonly=1 option to /buildtest

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

13 years agomisc/dashboard/app: revert gofix of app engine file
Andrew Gerrand [Mon, 5 Dec 2011 02:44:22 +0000 (13:44 +1100)]
misc/dashboard/app: revert gofix of app engine file

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

13 years agonet/mail: correctly compare parsed times in the test.
David Symonds [Sun, 4 Dec 2011 23:05:29 +0000 (10:05 +1100)]
net/mail: correctly compare parsed times in the test.

Fixes #2522.

R=golang-dev, bradfitz, alex.brainman
CC=golang-dev
https://golang.org/cl/5449084

13 years agogc: fix build (not sure how this edit got lost)
Russ Cox [Fri, 2 Dec 2011 20:05:45 +0000 (15:05 -0500)]
gc: fix build (not sure how this edit got lost)

R=ken2, ken
CC=golang-dev
https://golang.org/cl/5449072

13 years agogc: fix line number for redundant print
Russ Cox [Fri, 2 Dec 2011 19:58:26 +0000 (14:58 -0500)]
gc: fix line number for redundant print

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

13 years agogc: use gofmt spacing when printing map type
Russ Cox [Fri, 2 Dec 2011 19:45:07 +0000 (14:45 -0500)]
gc: use gofmt spacing when printing map type

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

13 years agogofmt -s misc src
Russ Cox [Fri, 2 Dec 2011 19:14:25 +0000 (14:14 -0500)]
gofmt -s misc src

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

13 years agogofmt: handle &T in composite literal simplify
Russ Cox [Fri, 2 Dec 2011 19:14:04 +0000 (14:14 -0500)]
gofmt: handle &T in composite literal simplify

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

13 years agogc: composite literals as per Go 1
Russ Cox [Fri, 2 Dec 2011 19:13:12 +0000 (14:13 -0500)]
gc: composite literals as per Go 1

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

13 years agospec: additional composite literal shortenings per Go 1 plan
Russ Cox [Fri, 2 Dec 2011 19:12:53 +0000 (14:12 -0500)]
spec: additional composite literal shortenings per Go 1 plan

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

13 years agogoinstall: fix typo in comment
Robert Griesemer [Fri, 2 Dec 2011 18:30:35 +0000 (10:30 -0800)]
goinstall: fix typo in comment

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

13 years agospec: pointer to array can be sliced
Russ Cox [Fri, 2 Dec 2011 18:11:30 +0000 (13:11 -0500)]
spec: pointer to array can be sliced

This has always been true, but we lost it from the spec
somewhere along the way, probably when we disallowed
the general 'pointer to anything sliceable' slice case.

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

13 years agogc: do not allow slice of array literal
Russ Cox [Fri, 2 Dec 2011 17:30:56 +0000 (12:30 -0500)]
gc: do not allow slice of array literal

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

13 years agodoc: do not slice array literal
Russ Cox [Fri, 2 Dec 2011 17:30:37 +0000 (12:30 -0500)]
doc: do not slice array literal

The special case in the spec is that you can take the
address of a composite literal using the & operator.

A composite literal is not, however, generally addressable,
and the slice operator requires an addressable argument,
so [3]int{1,2,3}[:] is invalid.  This tutorial code and one bug
report are the only places in the tree where it appears.

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

13 years agospec: avoid slice of array literal
Russ Cox [Fri, 2 Dec 2011 17:30:20 +0000 (12:30 -0500)]
spec: avoid slice of array literal

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

13 years agoexp/ssh: allow for msgUserAuthBanner during authentication
Gustav Paul [Fri, 2 Dec 2011 15:34:42 +0000 (10:34 -0500)]
exp/ssh: allow for msgUserAuthBanner during authentication

The SSH spec allows for the server to send a banner message to the client at any point during the authentication process. Currently the ssh client auth types all assume that the first response from the server after issuing a userAuthRequestMsg will be one of a couple of possible authentication success/failure messages. This means that client authentication breaks if the ssh server being connected to has a banner message configured.

This changeset refactors the noneAuth, passwordAuth and publickeyAuth types' auth() function and allows for msgUserAuthBanner during authentication.

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

13 years agoasn1: fix incorrect prints found by govet
Robert Hencke [Fri, 2 Dec 2011 15:13:02 +0000 (10:13 -0500)]
asn1: fix incorrect prints found by govet

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

13 years agonet, syscall: remove BindToDevice API from UDPConn, IPConn
Mikio Hara [Fri, 2 Dec 2011 14:18:16 +0000 (23:18 +0900)]
net, syscall: remove BindToDevice API from UDPConn, IPConn

For now a pair of socket options SOL_SOCKET and SO_BINDTODEVICE
is supported on Linux only. I'd like to demote BindToDevice API
to syscall level because it's Linux dependent one.

In the near future, probably we may have a bit more portable
API that using IPROTO_IP/IPV6 level socket options to specify,
identify an inbound, outbound IP interface on incoming, outgoing
UDP and raw IP packets.

R=cw, golang-dev
CC=golang-dev
https://golang.org/cl/5447071

13 years agoencoding/gob: don't send type info for unexported fields
Rob Pike [Fri, 2 Dec 2011 08:02:24 +0000 (00:02 -0800)]
encoding/gob: don't send type info for unexported fields
Fixes #2517.

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

13 years agobuild: update .hgignore
Andrew Gerrand [Fri, 2 Dec 2011 05:24:12 +0000 (16:24 +1100)]
build: update .hgignore

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

13 years agodashboard: make response format consistent, implement commit GET mode
Andrew Gerrand [Fri, 2 Dec 2011 05:05:12 +0000 (16:05 +1100)]
dashboard: make response format consistent, implement commit GET mode

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

13 years agoos/exec: make LookPath always search the current directory under Windows.
Benny Siegert [Fri, 2 Dec 2011 03:29:24 +0000 (14:29 +1100)]
os/exec: make LookPath always search the current directory under Windows.

cmd.exe implicitly looks in "." before consulting PATH.
LookPath should match this behavior.

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

13 years agodoc: correct weekly snapshot notes on hash.Hash change
Andrew Gerrand [Fri, 2 Dec 2011 02:36:21 +0000 (13:36 +1100)]
doc: correct weekly snapshot notes on hash.Hash change

I had the wrong idea when I wrote this.

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

13 years agotemplate: move the empty check into parse, which needs it when constructing
Rob Pike [Fri, 2 Dec 2011 01:24:54 +0000 (17:24 -0800)]
template: move the empty check into parse, which needs it when constructing
tree sets.

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

13 years agohtml: allow whitespace between head and body
Andrew Balholm [Fri, 2 Dec 2011 00:46:24 +0000 (11:46 +1100)]
html: allow whitespace between head and body

Also ignore <head> tag after </head>.

Pass tests6.dat, test 0:
<!doctype html></head> <head>

| <!DOCTYPE html>
| <html>
|   <head>
|   " "
|   <body>

Also pass tests through test 6:
<body>
<div>

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

13 years agogo/doc: exclude lines ending in ':' from possible headings
Robert Griesemer [Thu, 1 Dec 2011 23:14:15 +0000 (15:14 -0800)]
go/doc: exclude lines ending in ':' from possible headings

This is a more conservative approach to heading detection and
removes 11 headings from the current repository (several in
fmt). The current headscan output is:

/home/gri/go3/src/cmd/goinstall (package documentation)
        Remote Repositories
        The GOPATH Environment Variable
/home/gri/go3/src/pkg/exp/gotype (package documentation)
        Examples
/home/gri/go3/src/pkg/html/template (package template)
        Introduction
        Contexts
        Errors
        A fuller picture
        Contexts
        Typed Strings
        Security Model
/home/gri/go3/src/pkg/text/template (package template)
        Actions
        Arguments
        Pipelines
        Variables
        Examples
        Functions
        Associated templates
        Nested template definitions
18 headings found

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