1
0
mirror of https://github.com/golang/go synced 2024-10-03 11:21:22 -06:00
Commit Graph

12986 Commits

Author SHA1 Message Date
Luuk van Dijk
5583060c4c cmd/gc: fix addresses escaping through closures called in-place.
Fixes #3545.

R=rsc
CC=golang-dev
https://golang.org/cl/6061043
2012-04-23 15:39:01 -04:00
Pascal S. de Kloe
b678c19785 net/http: lex cleanup
R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/6099043
2012-04-23 10:26:10 -07:00
Shenghou Ma
e7e7b1c55c 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
2012-04-23 23:47:36 +08:00
Rob Pike
a8098cbcfd 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
2012-04-23 15:39:02 +10:00
Rob Pike
53372903c7 reflect: document and test TypeOf(nil)
Fixes #3549.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6107047
2012-04-23 12:07:02 +10:00
Andrew Balholm
0cc8ee9808 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
2012-04-22 16:19:21 +10:00
Rémy Oudompheng
cad480440d 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
2012-04-21 13:56:51 +02:00
Quan Yong Zhai
dd963ddf05 compress/zlib: minor fixes
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/6058043
2012-04-21 14:34:42 +10:00
Michael Chaten
32c3a626da runtime: add benchmark for complex128 division
R=golang-dev, dave, rsc
CC=golang-dev, minux.ma
https://golang.org/cl/6070043
2012-04-21 13:24:41 +10:00
Dave Cheney
1f14d45e7d 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
2012-04-21 10:01:32 +10:00
Andrew Balholm
904c7c8e99 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
2012-04-21 09:20:38 +10:00
Ian Lance Taylor
244706bd0f 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
2012-04-20 11:36:06 -07:00
Colby Ranger
a6d4471b2b 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
2012-04-20 09:31:23 -07:00
Shenghou Ma
dda6d6aa70 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
2012-04-20 23:45:43 +08:00
Andrew Gerrand
f8dde60e2b doc: don't wrap package names in directory listing
Fixes #3522.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6063054
2012-04-20 10:04:13 -04:00
Andrew Balholm
eea5a432cb 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
2012-04-20 15:48:13 +10:00
Andrew Balholm
6791057296 exp/html: ignore null bytes in text
pass one additional test

R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/6048051
2012-04-20 14:25:42 +10:00
Andrew Balholm
7d63ff09a5 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
2012-04-20 10:48:10 +10:00
Akshat Kumar
49a7da2dd9 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
2012-04-19 16:31:26 -07:00
Andrew Balholm
fca32f02e9 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
2012-04-20 09:08:58 +10:00
Shenghou Ma
acb550504f net/http: add example for FileServer to mention StripPrefix
Fixes #3530.

R=golang-dev, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/6032052
2012-04-20 00:41:10 +08:00
Brad Fitzpatrick
a682540547 A+C: add Bjorn Tillenius (Individual CLA)
R=golang-dev, kevlar
CC=golang-dev
https://golang.org/cl/6075045
2012-04-19 09:23:48 -07:00
Brad Fitzpatrick
3af088dbaf A+C: Add Michael Chaten (Individual CLA)
R=golang-dev, kevlar
CC=golang-dev
https://golang.org/cl/6075044
2012-04-19 09:18:49 -07:00
Andrew Balholm
c88ca5906c 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
2012-04-19 11:48:17 +10:00
Benny Siegert
e03dd509d4 doc/articles/image_draw.html: Change ColorImage to Uniform
Fixes #3474.

R=nigeltao
CC=golang-dev
https://golang.org/cl/6048050
2012-04-19 11:04:42 +10:00
Colby Ranger
5694ebf057 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
2012-04-18 11:33:02 -07:00
Adam Langley
6742d0a085 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
2012-04-18 13:41:11 -04:00
Andrew Balholm
b65c9a633e 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
2012-04-18 22:45:36 +10:00
Andrew Balholm
b39bbf1e5b 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
2012-04-18 13:26:35 +10:00
Brad Fitzpatrick
90aa56f271 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
2012-04-17 18:46:35 -07:00
Dave Cheney
b2c6116843 lib9: fix warning under clang 3.1
Fixes #3534.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6035054
2012-04-18 09:57:00 +10:00
Anthony Martin
d3889ff322 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
2012-04-17 15:51:05 -07:00
Andrew Balholm
9a6cef8bbf 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
2012-04-17 17:17:22 +10:00
David Symonds
b20163e9e4 flag: update style.
R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/6051044
2012-04-17 16:37:35 +10:00
Anthony Martin
3192cac587 cmd/prof: don't build on Plan 9 for now.
R=golang-dev, bradfitz, akumar
CC=golang-dev
https://golang.org/cl/5629054
2012-04-16 17:36:36 -07:00
Anthony Martin
74607d18c5 os: avoid panic when testing errors on Plan 9
R=golang-dev, bradfitz, akumar
CC=golang-dev
https://golang.org/cl/6017043
2012-04-16 17:36:02 -07:00
Akshat Kumar
4cf577edf9 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
2012-04-16 17:35:15 -07:00
Brad Fitzpatrick
bd7c4aee96 CONTRIBUTORS: add Colby Ranger (Google CLA)
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6037052
2012-04-16 10:25:20 -07:00
Shenghou Ma
50d5cf6bc9 doc/code: mention $GOBIN
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5989045
2012-04-17 02:41:27 +10:00
Joel Sing
99fc281743 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
2012-04-17 02:35:41 +10:00
Robert Hencke
c81705f13a time: parse fractional second with single digit
Fixes #3487.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6011050
2012-04-16 11:56:37 +10:00
Shenghou Ma
3180137b86 text/template/parse: fix doc comment
Fixes #3529.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6037046
2012-04-15 21:50:21 +08:00
Dave Cheney
84ef97b59c 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
2012-04-14 21:34:08 +10:00
Andrew Gerrand
0e596024c2 doc: update Mercurial installation instructions
R=r
CC=golang-dev
https://golang.org/cl/6031046
2012-04-14 13:27:11 +10:00
Rémy Oudompheng
061061e77c 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
2012-04-13 10:12:31 +02:00
Jongmin Kim
08f919f462 doc/effective_go.html: fixed the Request channel parameter
R=golang-dev, r
CC=golang-dev, gri
https://golang.org/cl/6010051
2012-04-13 15:22:40 +10:00
Gustavo Niemeyer
e4389c1d30 time: panic if UnixNano is out of range
R=golang-dev, remyoudompheng, dsymonds, gustavo, dchest, r, rsc
CC=golang-dev
https://golang.org/cl/5985059
2012-04-12 22:16:31 -03:00
Rob Pike
a662d3d9a7 fmt: fix crash of %b on huge negative int64
The buffer had 64 bytes but needs one more for the sign.

Fixes #3510.

R=golang-dev, dave, dsymonds
CC=golang-dev
https://golang.org/cl/6011057
2012-04-13 09:28:37 +10:00
Adam Langley
e6e8b72377 crypto/tls: don't always use the default private key.
When SNI based certificate selection is enabled, we previously used
the default private key even if we selected a non-default certificate.

Fixes #3367.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5987058
2012-04-12 12:35:21 -04:00
Adam Langley
55af51d5c0 encoding/pem: ignore spaces and tabs at the end of header lines.
Fixes #3502.

R=bradfitz
CC=golang-dev
https://golang.org/cl/6011046
2012-04-12 12:33:52 -04:00