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

8973 Commits

Author SHA1 Message Date
Robert Griesemer
8a089c07ec go/parser: slightly improved error message by adding hint
It's difficult to make this much better w/o much
more effort. This is a rare case and probably not
worth it.

Fixes #6052.

R=golang-codereviews, bradfitz, adonovan
CC=golang-codereviews
https://golang.org/cl/49740045
2014-01-09 14:51:23 -08:00
Shenghou Ma
9847c065f4 testing: document that ResetTimer also zeros the allocation counters.
Fixes #6998.

R=golang-codereviews, gobot, r
CC=golang-codereviews
https://golang.org/cl/44880044
2014-01-09 15:21:24 -05:00
Adam Langley
779ef7bd13 crypto/tls: support renegotiation extension.
The renegotiation extension was introduced[1] due to an attack by Ray in
which a client's handshake was spliced into a connection that was
renegotiating, thus giving an attacker the ability to inject an
arbitary prefix into the connection.

Go has never supported renegotiation as a server and so this attack
doesn't apply. As a client, it's possible that at some point in the
future the population of servers will be sufficiently updated that
it'll be possible to reject connections where the server hasn't
demonstrated that it has been updated to address this problem.

We're not at that point yet, but it's good for Go servers to support
the extension so that it might be possible to do in the future.

[1] https://tools.ietf.org/search/rfc5746

R=golang-codereviews, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/48580043
2014-01-09 13:38:11 -05:00
Rowan Worth
c4770b991b runtime: co-exist with NPTL's pthread_cancel.
NPTL uses SIGRTMIN (signal 32) to effect thread cancellation.
Go's runtime replaces NPTL's signal handler with its own, and
ends up aborting if a C library that ends up calling
pthread_cancel is used.

This patch prevents runtime from replacing NPTL's handler.

Fixes #6997.

R=golang-codereviews, iant, dvyukov
CC=golang-codereviews
https://golang.org/cl/47540043
2014-01-09 09:34:04 -08:00
Aram Hăvărneanu
6d0d08b849 os, os/exec, os/user: add support for GOOS=solaris
R=golang-codereviews, dave, minux.ma, gobot, jsing
CC=golang-codereviews
https://golang.org/cl/36020043
2014-01-10 02:49:37 +11:00
Ian Lance Taylor
7e639c0229 runtime: change errorCString to a struct
This prevents callers from using reflect to create a new
instance of errorCString with an arbitrary value and calling
the Error method to examine arbitrary memory.

Fixes #7084.

R=golang-codereviews, minux.ma, bradfitz
CC=golang-codereviews
https://golang.org/cl/49600043
2014-01-08 21:40:33 -08:00
Russ Cox
2d55fdb507 debug/goobj: add String methods for SymID and SymKind
R=iant
CC=golang-codereviews
https://golang.org/cl/48890044
2014-01-08 20:37:41 -05:00
Keith Randall
e7d010a6a7 runtime: deallocate specials before deallocating the underlying object.
R=dvyukov
CC=golang-codereviews
https://golang.org/cl/48840043
2014-01-08 12:41:26 -08:00
Ian Lance Taylor
89c5d17878 runtime: handle gdb breakpoint in x86 traceback
This lets stack splits work correctly when running under gdb
when gdb has inserted a breakpoint somewhere on the call
stack.

Fixes #6834.

R=golang-codereviews, minux.ma
CC=golang-codereviews
https://golang.org/cl/48650043
2014-01-08 12:36:31 -08:00
Jeff Sickel
a03e8a5be0 plan9: lookup query must seek to offset 0 before reading or
writing /net/dns or /net/cs (see nbd(8)).

R=golang-codereviews
CC=0intro, golang-codereviews, rsc
https://golang.org/cl/49060043
2014-01-08 21:22:18 +01:00
Brad Fitzpatrick
e7c21703a8 archive/zip: new test for earlier zip64 fix
Update #7069

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/49180043
2014-01-08 11:28:40 -08:00
Aram Hăvărneanu
f952d45508 all: add solaris build tags
R=golang-codereviews, minux.ma, gobot, rsc, dave
CC=golang-codereviews
https://golang.org/cl/36040043
2014-01-07 23:53:30 -05:00
Keith Randall
020b39c3f3 runtime: use special records hung off the MSpan to
record finalizers and heap profile info.  Enables
removing the special bit from the heap bitmap.  Also
provides a generic mechanism for annotating occasional
heap objects.

finalizers
        overhead      per obj
old	680 B	      80 B avg
new	16 B/span     48 B

profile
        overhead      per obj
old	32KB	      24 B + hash tables
new	16 B/span     24 B

R=cshapiro, khr, dvyukov, gobot
CC=golang-codereviews
https://golang.org/cl/13314053
2014-01-07 13:45:50 -08:00
Brad Fitzpatrick
affab3f312 net/http: fix data race when sharing request body between client and server
A server Handler (e.g. a proxy) can receive a Request, and
then turn around and give a copy of that Request.Body out to
the Transport. So then two goroutines own that Request.Body
(the server and the http client), and both think they can
close it on failure.  Therefore, all incoming server requests
bodies (always *http.body from transfer.go) need to be
thread-safe.

Fixes #6995

R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/46570043
2014-01-07 10:40:56 -08:00
Shawn Smith
39a396d2ba encoding/csv: test that carriage return is handled in Write
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/46310043
2014-01-07 09:32:15 -08:00
Joel Sing
9a7fb68359 crypto/sha512: avoid duplicate block declaration on 386
Unbreak the build - we do not have a sha512 block implementation in
386 assembly (yet).

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/48520043
2014-01-07 23:50:31 +11:00
Joel Sing
0a37002367 crypto/sha512: block implementation in amd64 assembly
Benchmark on Intel(R) Xeon(R) CPU X5650  @ 2.67GHz

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes         1779         1114  -37.38%
BenchmarkHash1K             9848         4894  -50.30%
BenchmarkHash8K            68513        32187  -53.02%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes         4.50         7.18    1.60x
BenchmarkHash1K           103.97       209.19    2.01x
BenchmarkHash8K           119.57       254.51    2.13x

R=agl
CC=golang-codereviews
https://golang.org/cl/37150044
2014-01-07 23:16:46 +11:00
Aram Hăvărneanu
901e7bfe53 lib9, libmach, cmd/dist, go/build: add support for GOOS=solaris
This change adds solaris to the list of supported operating
systems and allows cmd/dist to be built on Solaris.

This CL has to come first because we want the tools to ignore
solaris-specific files until the whole port is integrated.

R=golang-codereviews, jsing, rsc, minux.ma
CC=golang-codereviews
https://golang.org/cl/35900045
2014-01-07 23:12:12 +11:00
Joel Sing
8f9844348f syscall: include mmap constants in netbsd zerror* files
Include the <sys/mman.h> header for NetBSD mkerrors.sh. This brings
in constants used with mmap(2), msync(2) and mlockall(2).

The regeneration of the NetBSD zerror* files also picks clone(2)
related constants.

Update #4929.

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/45510044
2014-01-07 23:04:17 +11:00
Adam Langley
78c16c9b16 crypto/rsa: support unpadded signatures.
Usually when a message is signed it's first hashed because RSA has low
limits on the size of messages that it can sign. However, some
protocols sign short messages directly. This isn't a great idea because
the messages that can be signed suddenly depend on the size of the RSA
key, but several people on golang-nuts have requested support for
this and it's very easy to do.

R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/44400043
2014-01-06 16:11:58 -05:00
Brad Fitzpatrick
90e9669c50 undo CL 44150043 / 198bdc0984dd
See https://golang.org/cl/44150043/

««« original CL description
regexp: use sync.Pool

For machines, not threads.

Update #4720

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

TBR=golang-dev
CC=golang-codereviews
https://golang.org/cl/48190043
2014-01-06 12:38:04 -08:00
Brad Fitzpatrick
02a15e7165 archive/zip: fix bug reading zip64 files
ZIP64 Extra records are variably sized, but we weren't capping
our reading of the extra fields at its previously-declared
size.

No test because I don't know how to easily create such files
and don't feel like manually construction one.  But all
existing tests pass, and this is "obviously correct" (queue
laughter).

Fixes #7069

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/48150043
2014-01-06 10:43:56 -08:00
Matthew Cottingham
991e9a8331 net/http: Add more call order tests for request form parsing.
Adds tests for branches handling call ordering which
were shown to be untested by the cover tool.

This is part of the refactoring of form parsing discussed
in CL 44040043. These tests may need to be changed later but
should help lock in the current behaviour.

R=golang-codereviews, dave, bradfitz
CC=golang-codereviews
https://golang.org/cl/46750043
2014-01-06 10:36:04 -08:00
Bill Thiede
6576757927 hash/fnv: fix overview link currently returning 404.
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/47570043
2014-01-06 10:34:24 -08:00
Shawn Smith
16134060de time: add tests for Tick, NewTicker with negative duration
R=golang-codereviews, gobot, r, bradfitz
CC=golang-codereviews
https://golang.org/cl/37660044
2014-01-06 10:32:07 -08:00
Joel Sing
232a4e89a4 crypto/sha256: block implementation in 386 assembly
Benchmark on Intel(R) Core(TM) i5-2500S CPU @ 2.70GHz (albeit in a VM)

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes         1606          699  -56.48%
BenchmarkHash1K            21920         7268  -66.84%
BenchmarkHash8K           165696        53756  -67.56%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes         4.98        11.44    2.30x
BenchmarkHash1K            46.72       140.88    3.02x
BenchmarkHash8K            49.44       152.39    3.08x

R=agl, cldorian
CC=golang-codereviews
https://golang.org/cl/44800044
2014-01-06 13:31:22 -05:00
Volker Dobler
939b3fa39e net/http: remove todos from cookie code
The Domain and Path field of a parsed cookie have been
the unprocessed wire data since Go 1.0; this seems to
be okay for most applications so let's keep it.

Returning the unprocessed wire data makes it easy to
handle nonstandard or even broken clients without
consulting Raw or Unparsed of a cookie.

The RFC 6265 parsing rules for domain and path are
currently buried in net/http/cookiejar but could be
exposed in net/http if necessary.

R=bradfitz, nigeltao
CC=golang-codereviews
https://golang.org/cl/48060043
2014-01-06 10:00:58 -08:00
Volker Dobler
eb93f86275 net/http/cookiejar: document format of domain in PublicSuffix
Document what values a PublicSuffixList must accept as
a domain in a call to PublicSuffix.

R=bradfitz, nigeltao
CC=golang-codereviews
https://golang.org/cl/47560044
2014-01-06 10:00:20 -08:00
Emil Hessman
aeeda707ff runtime: Fix panic when trying to stop CPU profiling with profiler turned off
Fixes #7063.

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/47950043
2014-01-06 09:53:55 -08:00
Joel Sing
29fe067ba7 crypto/sha1, crypto/sha256, crypto/sha512: use copy for partial block
Use copy rather than a hand rolled loop when moving a partial input
block to the scratch area. This results in a reasonable performance
gain when partial blocks are written.

Benchmarks on Intel(R) Xeon(R) CPU X5650  @ 2.67GHz with Go amd64:

       benchmark               old MB/s     new MB/s  speedup
SHA1   BenchmarkHash8Bytes        18.37        22.80    1.24x
SHA256 BenchmarkHash8Bytes        11.86        13.78    1.16x
SHA512 BenchmarkHash8Bytes         4.51         5.24    1.16x

       benchmark              old ns/op    new ns/op    delta
SHA1   BenchmarkHash8Bytes          435          350  -19.54%
SHA256 BenchmarkHash8Bytes          674          580  -13.95%
SHA512 BenchmarkHash8Bytes         1772         1526  -13.88%

R=agl, dave, bradfitz
CC=golang-codereviews
https://golang.org/cl/35840044
2014-01-06 01:34:56 +11:00
Shawn Smith
48334e3e91 container/list: improve test coverage
R=golang-codereviews, dave, gobot, bradfitz, gri
CC=golang-codereviews
https://golang.org/cl/46640043
2014-01-05 07:48:32 +11:00
Jeff Sickel
c136197ca8 runtime: plan 9 does have /dev/random
R=golang-codereviews, r, aram
CC=0intro, golang-codereviews, rsc
https://golang.org/cl/43420045
2014-01-04 10:53:22 -08:00
Keith Randall
f59ea4e58b runtime: Fix race detector checks to ignore KindNoPointers bit
when comparing kinds.

R=dvyukov, dave, khr
CC=golang-codereviews
https://golang.org/cl/41660045
2014-01-04 08:43:17 -08:00
Dave Cheney
30ba286c61 os: add tests for operations on nil *File methods
R=shawn.p.smith, gobot, r
CC=golang-codereviews
https://golang.org/cl/46820043
2014-01-04 09:58:04 +11:00
Dave Cheney
f2e946f9ed os: return ErrInvalid if receiver is nil.
Fixes #7043.

Test coming in https://golang.org/cl/46820043

R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/38330045
2014-01-04 08:25:09 +11:00
Emil Hessman
880442f110 encoding/json: Fix missing error when trying to unmarshal null string into int, for successive ,string option
Fixes #7046.

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/47260043
2014-01-03 10:13:28 -08:00
Joel Sing
d180579170 syscall: handle varied path lengths for unix sockets
Most BSDs include the trailing NUL character of the socket path in the
length, however some do not (such as NetBSD 6.99). Handle this by only
subtracting the family and length bytes from the returned length, then
scanning the path and removing any terminating NUL bytes.

Fixes #6627.

R=golang-codereviews, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/46420044
2014-01-04 00:29:20 +11:00
David Symonds
8778760a7e runtime: increase attempt count for map iteration order test.
Some builders broke on this test; I'm guessing that was because
this test didn't try hard enough to find a different iteration order.

Update #6719

R=dave
CC=golang-codereviews
https://golang.org/cl/47300043
2014-01-03 10:41:56 +11:00
David Symonds
d4c66a35ba runtime: add a test for randomised map iteration order.
Technically the spec does not guarantee that the iteration order is random,
but it is a property that we have consciously pursued, and so it seems
right to verify that our implementation does indeed randomise.

Update #6719.

R=khr, bradfitz
CC=golang-codereviews
https://golang.org/cl/47010043
2014-01-03 10:10:54 +11:00
Shawn Smith
eaff83b98e encoding/hex: add Decode error test case
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/46880043
2014-01-02 10:34:21 -08:00
Shawn Smith
b38da05ab1 time: add tests for Duration.Nanoseconds, Duration.Minutes, and Duration.Hours
R=golang-codereviews, rsc, dave
CC=golang-codereviews
https://golang.org/cl/42440043
2014-01-02 21:01:18 +11:00
Dave Cheney
66730120fa encoding/json: add tests for InvalidUnmarshalError
R=golang-codereviews, shawn.p.smith
CC=golang-codereviews
https://golang.org/cl/41960047
2014-01-02 09:49:55 +11:00
Shawn Smith
4d239bcea2 bufio: improve NewReaderSize, Peek, and UnreadByte test coverage
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/42990045
2014-01-01 22:26:22 +11:00
Shawn Smith
a39f3b29ec encoding/json: improve omitempty test coverage
R=golang-codereviews, dave, bradfitz
CC=golang-codereviews
https://golang.org/cl/46250043
2014-01-01 17:54:06 +11:00
Shawn Smith
3c7d2e6af9 os: improve Readdir and Readdirnames test coverage
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46450043
2014-01-01 16:40:52 +11:00
Shawn Smith
873271378b encoding/hex: add Decode test case with uppercase hex characters
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46270043
2014-01-01 16:32:05 +11:00
Michael Stapelberg
592416a387 debug/elf: add C source for testdata executables
This source file, when compiled with gcc 4.4.3 on Ubuntu lucid,
corresponds instruction for instruction to the binaries in the same
directory.

Shipping this source code file resolves http://bugs.debian.org/716853

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/46780043
2013-12-31 14:36:13 -08:00
Shawn Smith
e3040e2bba crypto/sha256: add tests for Size() and BlockSize()
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46470043
2014-01-01 07:46:00 +11:00
Shawn Smith
0333e80d63 crypto/sha1: add tests for Size() and BlockSize()
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46400044
2013-12-31 23:13:05 +11:00
Shawn Smith
a1731ac078 container/ring: add test for Move with empty Ring
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46630044
2013-12-31 21:18:40 +11:00
Mikio Hara
b4571bdfe8 net: fix typo
R=golang-codereviews, bradfitz, dave
CC=golang-codereviews
https://golang.org/cl/46600043
2013-12-31 18:52:37 +09:00
Shawn Smith
dcf562dfb6 crypto/sha512: add tests for Size() and BlockSize()
R=golang-codereviews, bradfitz, dave
CC=golang-codereviews
https://golang.org/cl/43550047
2013-12-31 19:29:09 +11:00
Josh Bleecher Snyder
ff006982c3 text/template: don't panic when using AddParseTree with an unparsed template
Fixes #7032.

R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/43960045
2013-12-30 17:17:19 -08:00
Keith Randall
1cc2ff8fc7 runtime: use readrange instead of read to check for races
on map keys and values which are now passed by reference.

R=dvyukov, khr
CC=golang-codereviews
https://golang.org/cl/43490044
2013-12-30 12:03:56 -08:00
Richard Musiol
7ff57e2fa1 reflect: fixed method name in Slice3 error message
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/46500043
2013-12-30 11:41:01 -08:00
Shawn Smith
96ee10fb71 reflect: add DeepEqual slice of slice inequality test
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/46510043
2013-12-30 11:39:47 -08:00
Shawn Smith
c989a0b2f7 reflect: remove length check for arrays in deepValueEqual
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/39910044
2013-12-29 11:05:30 -08:00
Shawn Smith
36c8c5f063 io: add tests for SectionReader ReadAt and Size
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/39200045
2013-12-29 22:38:05 +11:00
Shawn Smith
351caa4b91 crypto/hmac: add tests for Size() and BlockSize()
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/41320044
2013-12-29 20:56:05 +11:00
Dave Cheney
d2fe44d568 runtime: load runtime.goarm as a byte, not a word
Fixes #6952.

runtime.asminit was incorrectly loading runtime.goarm as a word, not a uint8 which made it subject to alignment issues on arm5 platforms.

Alignment aside, this also meant that the top 3 bytes in R11 would have been garbage and could not be assumed to be setting up the FPU reliably.

R=iant, minux.ma
CC=golang-codereviews
https://golang.org/cl/46240043
2013-12-29 15:25:34 +11:00
Ian Lance Taylor
672525a56e net: work around Solaris connect issue when server closes socket
On Solaris, if you do a in-progress connect, and then the
server accepts and closes the socket, the client's later
attempt to complete the connect will fail with EINVAL.  Handle
this case by assuming that the connect succeeded.  This code
is weird enough that it is implemented as Solaris-only so that
it doesn't hide a real error on a different OS.

Update #6828

R=golang-codereviews, bradfitz, dave
CC=golang-codereviews
https://golang.org/cl/46160043
2013-12-28 09:37:54 -08:00
Shawn Smith
872f5ffa09 bytes: add test for Contains
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46140043
2013-12-28 20:33:05 +11:00
Shawn Smith
42cea1a452 archive/tar: add test case for passing nil to FileInfoHeader
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/44710044
2013-12-28 16:14:49 +11:00
Martin Olsson
5499034a71 all: fix a few spelling errors in source comments
R=golang-codereviews, dave, iant
CC=golang-codereviews
https://golang.org/cl/45750044
2013-12-27 08:59:02 -08:00
Ian Lance Taylor
4aa521a77d net: use DialTimeout in TestSelfConnect
This avoids problems with systems that take a long time to
find out nothing is listening, while still testing for the
self-connect misfeature since a self-connect should be fast.
With this we may be able to remove the test for non-Linux
systems.

Tested (on GNU/Linux) by editing selfConnect in
tcpsock_posix.go to always return false and verifying that
TestSelfConnect then fails with and without this change.

Idea from Uros Bizjak.

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/39200044
2013-12-27 08:49:47 -08:00
Shawn Smith
d1a9143669 strconv: add tests for FormatBool and AppendBool
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/42480043
2013-12-27 08:40:14 -08:00
Shawn Smith
f485e9859a strconv: remove unused atof32int function
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/44200044
2013-12-27 08:40:03 -08:00
Shawn Smith
4133407061 crypto/cipher: remove unused shift1 function
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/38990045
2013-12-27 08:39:54 -08:00
Brad Fitzpatrick
2ccc9a965b net/http: quiet distracting test spam
Capture log output (and test it while at it),
and quiet unnecessary t.Logf.

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/45850043
2013-12-26 13:03:30 -08:00
Brad Fitzpatrick
1fa0206024 net/http: fix data race in benchmark
Fixes #7006

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/44940044
2013-12-26 12:16:11 -08:00
John Newlin
92b5e16147 net/http: Release reference to chunkWriter's bufio.Writer on hijack
When a connection is hijacked, release the reference to the bufio.Writer
that is used with the chunkWriter.  The chunkWriter is not used after
the connection is hijacked.

Also add a test to check that double Hijack calls do something sensible.

benchmark                old ns/op    new ns/op    delta
BenchmarkServerHijack        24137        20629  -14.53%

benchmark               old allocs   new allocs    delta
BenchmarkServerHijack           21           19   -9.52%

benchmark                old bytes    new bytes    delta
BenchmarkServerHijack        11774         9667  -17.90%

R=bradfitz, dave, chris.cahoon
CC=golang-codereviews
https://golang.org/cl/39440044
2013-12-26 11:52:14 -08:00
Marko Tiikkaja
0d12e24ebb database/sql: Use all connections in pool
The last connection in the pool was not being handed out correctly.

R=golang-codereviews, gobot, bradfitz
CC=golang-codereviews
https://golang.org/cl/40410043
2013-12-26 11:27:18 -08:00
Ian Lance Taylor
59583b09f3 runtime/cgo: include <signal.h> to fix build
R=golang-codereviews
TBR=dfc
CC=golang-codereviews
https://golang.org/cl/43120044
2013-12-24 08:24:32 -08:00
Ian Lance Taylor
699dbb60b7 runtime/cgo: always set signal mask before calling pthread_create
This was done correctly for most targets but was missing from
FreeBSD/ARM and Linux/ARM.

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/45180043
2013-12-24 08:08:15 -08:00
S.Çağlar Onur
41183d015d cgo/runtime: replace sigprocmask with pthread_sigmask.
sigprocmask use in a multithreaded environment is undefined so replace it with pthread_sigmask.

Fixes #6811.

R=jsing, iant
CC=golang-codereviews, golang-dev
https://golang.org/cl/30460043
2013-12-22 08:55:29 -08:00
Shawn Smith
7054890715 bytes, strings: improve Title test coverage by adding cases with underscore and unicode line separator
R=golang-codereviews, gobot, r
CC=golang-codereviews
https://golang.org/cl/42310045
2013-12-20 23:19:32 -08:00
David du Colombier
4237ffe5ea os: reimplement HasPrefix and LastIndex to not depend on strings
R=golang-codereviews, rsc
CC=golang-codereviews, jas
https://golang.org/cl/44790043
2013-12-21 01:22:10 +01:00
Jakub Ryszard Czarnowicz
57e27a879e net/http: empty contenty-type treated as application/octet-stream
RFC 2616, section 7.2.1 - empty type SHOULD be treated as
application/octet-stream.
Fixes #6616.

R=golang-codereviews, gobot, bradfitz, josharian
CC=golang-codereviews
https://golang.org/cl/31810043
2013-12-20 11:49:42 -08:00
Rob Pike
dc8572c3fe sync: explain Pool's intentions
Expand the type's doc comment to make its purpose clear
and discourage misuse.

R=golang-codereviews, gobot, rsc
CC=golang-codereviews
https://golang.org/cl/44680043
2013-12-20 11:15:50 -08:00
Brad Fitzpatrick
568a449bd1 io/ioutil: use sync.Pool in Discard
And merge the blackhole.go file back into ioutil,
where it once was. It was only in a separate file
because it used to have race-vs-!race versions.

R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/44060044
2013-12-20 09:38:35 -08:00
Adam Langley
6f149492bf crypto/tls: rework reference tests.
The practice of storing reference connections for testing has worked
reasonably well, but the large blocks of literal data in the .go files
is ugly and updating the tests is a real problem because their number
has grown.

This CL changes the way that reference tests work. It's now possible to
automatically update the tests and the test data is now stored in
testdata/. This should make it easier to implement changes that affect
all connections, like implementing the renegotiation extension.

R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/42060044
2013-12-20 11:37:05 -05:00
Alex A Skinner
487dff1852 net: ParseIP should return nil if :: doesn't expand in an IPv6 address.
Per RFC 4291, 'The use of "::" indicates one or more groups of 16 bits of zeros.'
Fixes #6628

R=golang-dev, rsc, minux.ma, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/15990043
2013-12-20 21:29:28 +09:00
Shenghou Ma
eb7ed0d626 runtime: fix build for OpenBSD
R=golang-dev
CC=golang-dev
https://golang.org/cl/38030045
2013-12-19 21:12:18 -05:00
Shenghou Ma
0097d30c97 runtime: unblock signals when we try to core dump
Fixes #6988.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/44070046
2013-12-19 20:45:05 -05:00
Keith Randall
cbc565a801 reflect: rewrite Value to separate out pointer vs. nonpointer info.
Needed for precise gc and copying stacks.

reflect.Value now takes 4 words instead of 3.

Still to do:
 - un-iword-ify channel ops.
 - un-iword-ify method receivers.

R=golang-dev, iant, rsc, khr
CC=golang-dev
https://golang.org/cl/43040043
2013-12-19 15:15:24 -08:00
Brad Fitzpatrick
cbf6ff3b90 net/http: add Hihack benchmark
Notably, to show allocs. Currently: 11766 B/op, 21 allocs/op,
at least one alloc of which is in the benchmark loop itself.

R=golang-dev, jnewlin
CC=golang-dev
https://golang.org/cl/40370057
2013-12-19 13:24:42 -08:00
Rémy Oudompheng
e6b023473e runtime: reduce delays in finalizer test.
The runtime tests are executed 4 times in all.bash
and there is currently a 5-second delay each time.

R=golang-dev, minux.ma, khr, bradfitz
CC=golang-dev
https://golang.org/cl/42450043
2013-12-19 21:37:44 +01:00
David du Colombier
16dcef80d4 os: rename only works as part of the same directory on Plan 9
R=golang-dev, lucio.dere, rsc
CC=golang-dev
https://golang.org/cl/44080046
2013-12-19 21:20:03 +01:00
Rob Pike
6f6ff95183 go/build: mention 'tag' as an alias for 'build constraint'
The code is all about tags, and the cmd/go documentation
said to look in the go/build documentation for information
about tags, but the documentation said nothing about tags,
only build constraints. Make things clearer.

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/44100043
2013-12-19 11:43:34 -08:00
Adam Langley
9144ef3321 crypto/x509: import crypto/sha256
Since SHA-256 is now the default hash function, x509 should import it
otherwise some programs may fail because it hasn't been linked in.

R=golang-dev, dave, minux.ma
CC=golang-dev
https://golang.org/cl/44010047
2013-12-19 14:06:28 -05:00
Mikio Hara
efd1d05023 net: rename TestReadConfig to TestDNSReadConfig
To make it possible to type "go test -run=DNS".
Also removes unnecessary parens.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/43470051
2013-12-19 13:02:06 +09:00
Alex Brainman
7f8a5057dd syscall: add NewCallbackCDecl again
Fixes #6338

R=golang-dev, kin.wilson.za, rsc
CC=golang-dev
https://golang.org/cl/36180044
2013-12-19 14:38:50 +11:00
Alex Brainman
f18e2a3271 runtime/pprof: skip tests that fail on windows-amd64-race builder
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/44180043
2013-12-19 14:15:57 +11:00
Brad Fitzpatrick
0594f89489 compress/flate: use io.ByteReader in docs
We did this elsewhere when io.ByteReader was added
but forgot this one.

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/43480052
2013-12-18 18:24:55 -08:00
Keith Randall
2d20c0d625 runtime: mark objects in free lists as allocated and unscannable.
On the plus side, we don't need to change the bits when mallocing
pointerless objects.  On the other hand, we need to mark objects in the
free lists during GC.  But the free lists are small at GC time, so it
should be a net win.

benchmark                    old ns/op    new ns/op    delta
BenchmarkMalloc8                    40           33  -17.65%
BenchmarkMalloc16                   45           38  -15.72%
BenchmarkMallocTypeInfo8            58           59   +0.85%
BenchmarkMallocTypeInfo16           63           64   +1.10%

R=golang-dev, rsc, dvyukov
CC=cshapiro, golang-dev
https://golang.org/cl/41040043
2013-12-18 17:13:59 -08:00
Mikio Hara
7eb45d3c4a net: don't return a nested error when happy eyeballs dialing
Also removes an unused variable.

Fixes #6795.

R=adg, dave, bradfitz, gobot
CC=golang-dev
https://golang.org/cl/29440043
2013-12-19 10:00:15 +09:00
Brad Fitzpatrick
b682f6de5a regexp: use sync.Pool
For machines, not threads.

Update #4720

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/44150043
2013-12-18 16:43:19 -08:00
Russ Cox
2404b7f168 debug/goobj: expand package prefix correctly
R=r, bradfitz
CC=golang-dev
https://golang.org/cl/43480049
2013-12-18 19:00:52 -05:00
David du Colombier
674606503e syscall: disallow slashes in file names on Plan 9
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/43480050
2013-12-19 00:58:23 +01:00
Brad Fitzpatrick
93e4a9d84c net/http: use sync.Pool
Update #4720

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/44080043
2013-12-18 15:52:20 -08:00
Brad Fitzpatrick
46b4ed2cf0 encoding/json: use sync.Pool
Benchmark is within the noise. I had to run this a dozen times
each before & after (on wall power, without a browser running)
before I could get halfway consistent numbers, and even then
they jumped all over the place, with the new one sometimes
being better. But these are the best of a dozen each.

Slowdown is expected anyway, since I imagine channels are
optimized more.

benchmark                 old ns/op    new ns/op    delta
BenchmarkCodeEncoder       26556987     27291072   +2.76%
BenchmarkEncoderEncode         1069         1071   +0.19%

benchmark                  old MB/s     new MB/s  speedup
BenchmarkCodeEncoder          73.07        71.10    0.97x

benchmark                old allocs   new allocs    delta
BenchmarkEncoderEncode            2            2    0.00%

benchmark                 old bytes    new bytes    delta
BenchmarkEncoderEncode          221          221    0.00%

Update #4720

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/37720047
2013-12-18 15:52:05 -08:00
Mikio Hara
2b3ad827a6 net: add test cases for the both of netgo, cgo DNS lookups
Update #4078

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/14638043
2013-12-19 07:40:10 +09:00
Jakob Borg
2b693b7c19 encoding/asn1: Fix parsing of non-printable strings in
sequences.

Use the same criteria for when to modify the tag type when
parsing a string in a sequence as when parsing a bare string
field.

Fixes #6726.

R=golang-dev, bradfitz, gobot, agl
CC=golang-dev
https://golang.org/cl/22460043
2013-12-18 17:06:17 -05:00
Jeff R. Allen
17dc712c18 math/rand: Float32/64 must only return values in [0,1)
Float32 and Float64 are now both created by taking the ratio
of two integers which are chosen to fit entirely into the
precision of the desired float type. The previous code
could cast a Float64 with more than 23 bits of ".99999"
into a Float32 of 1.0, which is not in [0,1).

Float32 went from 15 to 21 ns/op (but is now correct).

Fixes #6721.

R=golang-dev, iant, rsc
CC=golang-dev
https://golang.org/cl/22730043
2013-12-18 15:38:53 -05:00
Nigel Tao
ff6b922361 image/gif: respect local color table transparency.
Fixes #6441.

R=r
CC=andybons, golang-dev
https://golang.org/cl/13829043
2013-12-18 15:10:40 -05:00
Brad Fitzpatrick
0f9311811c fmt: use sync.Pool
Update #4720

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/43990043
2013-12-18 11:09:07 -08:00
Brad Fitzpatrick
8c6ef061e3 sync: add Pool type
Adds the Pool type and docs, and use it in fmt.
This is a temporary implementation, until Dmitry
makes it fast.

Uses the API proposal from Russ in http://goo.gl/cCKeb2 but
adds an optional New field, as used in fmt and elsewhere.
Almost all callers want that.

Update #4720

R=golang-dev, rsc, cshapiro, iant, r, dvyukov, khr
CC=golang-dev
https://golang.org/cl/41860043
2013-12-18 11:08:34 -08:00
Shawn Smith
b758d8703a encoding/csv: remove unused unreadRune function
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/37720046
2013-12-18 13:29:27 -05:00
Shawn Smith
a025e1caac html: add tests for UnescapeString edge cases
R=golang-dev, gobot, bradfitz
CC=golang-dev
https://golang.org/cl/40810044
2013-12-18 10:20:25 -08:00
Shawn Smith
c22e79b37b encoding/asn1: add more test cases for BitString.At and TestUTCTime, add test for ObjectIdentifier.Equal
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/42740043
2013-12-18 10:19:07 -08:00
Shawn Smith
aa20d26292 encoding/json: add test for HTMLEscape
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/38220044
2013-12-18 10:18:35 -08:00
Robert Griesemer
108d35bd8e go/ast: added example illustrating CommentMap use.
R=bradfitz
CC=golang-dev
https://golang.org/cl/43930043
2013-12-18 10:10:40 -08:00
Shawn Smith
9d1832f227 encoding/ascii85: add empty string case for Encode test
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/36830046
2013-12-18 08:33:59 -08:00
Anfernee Yongkun Gui
b3f38b4630 net: test dnsconfig_unix with sample resolv.conf
R=golang-dev, adg, bradfitz, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/21580043
2013-12-18 08:26:36 -08:00
Adam Langley
ca3ff9251d crypto/x509: set default signature hash to SHA256 and allow override.
Previously the hash used when signing an X.509 certificate was fixed
and, for RSA, it was fixed to SHA1. Since Microsoft have announced the
deprecation of SHA1 in X.509 certificates, this change switches the
default to SHA256.

It also allows the hash function to be controlled by the caller by
setting the SignatureAlgorithm field of the template.

[1] http://blogs.technet.com/b/pki/archive/2013/11/12/sha1-deprecation-policy.aspx

Fixes #5302.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/40720047
2013-12-18 10:57:56 -05:00
Josh Bleecher Snyder
4f23481483 crypto/x509: add non-cgo darwin system anchor certs
The set of certs fetched via exec'ing `security` is not quite identical
to the certs fetched via the cgo call. The cgo fetch includes
any trusted root certs that the user may have added; exec does not.
The exec fetch includes an Apple-specific root cert; the cgo fetch
does not. Other than that, they appear to be the same.

Unfortunately, os/exec depends on crypto/x509, via net/http. Break the
circular dependency by moving the exec tests to their own package.

This will not work in iOS; we'll cross that bridge when we get to it.

R=golang-dev, minux.ma, agl
CC=golang-dev
https://golang.org/cl/22020045
2013-12-18 10:57:07 -05:00
Brad Fitzpatrick
626da8d737 encoding/json: speed up decoding
Don't make copies of keys while decoding, and don't use the
expensive strings.EqualFold when it's not necessary. Instead,
note in the existing field cache what algorithm to use to
check fold equality... most keys are just ASCII letters.

benchmark               old ns/op    new ns/op    delta
BenchmarkCodeDecoder    137074314    103974418  -24.15%

benchmark                old MB/s     new MB/s  speedup
BenchmarkCodeDecoder        14.16        18.66    1.32x

Update #6496

R=golang-dev, rsc, adg, r, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/13894045
2013-12-18 07:30:21 -08:00
Andrew Gerrand
9f2b2dfa86 log: fix example (fix build)
R=golang-dev
CC=golang-dev
https://golang.org/cl/43780043
2013-12-18 17:25:23 +11:00
ChaiShushan
8c530becaf log: add example
Fixes #6028.

R=golang-dev, bradfitz, adg, r
CC=golang-dev
https://golang.org/cl/43320043
2013-12-18 16:24:11 +11:00
ChaiShushan
8eb508dd08 flag: remove unused FlagSet.exitOnError field
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/14279043
2013-12-17 23:18:12 -05:00
Mikio Hara
f439e07b1b net: make TestDNSThreadLimit execute at the end of tests
Because TestDNSThreadLimit consumes tons of file descriptors and
makes other tests flaky when CGO_ENABLE=0 or being with netgo tag.

Fixes #6580.

R=golang-dev, bradfitz, adg, minux.ma
CC=golang-dev
https://golang.org/cl/14639044
2013-12-18 13:05:47 +09:00
Alex Brainman
ae9e4db07c runtime: skip broken TestRuntimeGogoBytes on windows
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/43730043
2013-12-18 14:17:47 +11:00
Keith Randall
deb554934c runtime, gc: call interface conversion routines by reference.
Part of getting rid of vararg C calls.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/23310043
2013-12-17 16:55:06 -08:00
David du Colombier
bccf029fc0 net: rewrite toLower more clearly
Rob suggested this change.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/43670044
2013-12-17 16:32:27 -08:00
Keith Randall
9aae6c1a8b runtime: don't store evacuate bit as low bit of hashtable overflow pointer.
Hash tables currently store an evacuated bit in the low bit
of the overflow pointer.  That's probably not sustainable in the
long term as GC wants correctly typed & aligned pointers.  It is
also a pain to move any of this code to Go in the current state.

This change moves the evacuated bit into the tophash entries.

Performance change is negligable.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/14412043
2013-12-17 15:23:31 -08:00
Marko Tiikkaja
ab05a855c6 database/sql: Fix inaccurate comment
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/40370051
2013-12-17 14:53:31 -08:00
Michael Hudson-Doyle
0a6ad46b4f reflect: Add tests for Call with functions taking and returning structs.
gccgo has problems using reflect.Call with functions that take and
return structs with no members.  Prior to fixing that problem there, I
thought it sensible to add some tests of this situation.

Update #6761

First contribution to Go, apologies in advance if I'm doing it wrong.

R=golang-dev, dave, minux.ma, iant, khr, bradfitz
CC=golang-dev
https://golang.org/cl/26570046
2013-12-17 14:49:51 -08:00
Caleb Spare
e9895d92e0 container/list: Add missing period to doc comment for Front
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/38540046
2013-12-17 14:21:11 -08:00
David du Colombier
e87b171013 net: reimplement toLower to not depend on strings
R=golang-dev, r, bradfitz
CC=golang-dev, jas
https://golang.org/cl/43610043
2013-12-17 14:19:11 -08:00
Brad Fitzpatrick
4b76a31c6d runtime: don't crash in SetFinalizer if sizeof *x is zero
And document it explicitly, even though it already said
it wasn't guaranteed.

Fixes #6857

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/43580043
2013-12-17 14:18:58 -08:00
Arne Hormann
a1a3d21355 database/sql: fix typo in comment
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/43300043
2013-12-18 08:17:43 +11:00
Brad Fitzpatrick
ff8e45828c os: avoid a string concat in readdir
R=golang-dev, crawshaw
CC=golang-dev
https://golang.org/cl/37690045
2013-12-17 12:25:32 -08:00
Brad Fitzpatrick
6a1a2170bc os, path/filepath: don't ignore Lstat errors in Readdir
os: don't ignore LStat errors in Readdir. If it's ENOENT,
on the second pass, just treat it as missing. If it's another
error, it's real.

path/filepath: use ReaddirNames instead of Readdir in Walk,
in order to obey the documented WalkFunc contract of returning
each walked item's LStat error, if any.

Fixes #6656
Fixes #6680

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/43530043
2013-12-17 12:19:01 -08:00
Julien Schmidt
762a9d934e database/sql: fix auto-reconnect in prepared statements
This also fixes several connection leaks.
Fixes #5718

R=bradfitz, adg
CC=alberto.garcia.hierro, golang-dev
https://golang.org/cl/14920046
2013-12-17 11:57:30 -08:00
Rob Pike
a075fdbaa6 image: roll back 13239051 (add RGB and RGB48)
They cause too much bloat in the internals as we find ourselves adding
special case code for all the cross-connections. It's better to use RGBA
and just max out the alpha. We lose a little memory but reduce the number
of special cases the encoders, decoders, and drawers need to provide.

R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/42910045
2013-12-17 10:49:45 -08:00
ChaiShushan
64379b854f all: add missing copyright
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/43290043
2013-12-17 06:52:32 -08:00
Shenghou Ma
98f16ad112 time: fix test error in Chinese edition of Windows
On the Chinese Windows XP system that I'm using, GetTimeZoneInformation returns a struct containing "中国标准时间" (China Standard Time in Chinese) in both StandardName and DaylightName (which is correct, because China does not use DST). However, in registry, under key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\China Standard Time, the key Std and Dlt contain "中国标准时间" (China Standard Time in Chinese) and "中国夏季时间" (China Summer Time in Chinese) respectively. This means that time.toEnglishName() cannot determine the abbreviation for the local timezone (CST) and causes test failures (time.Local is empty)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/43210043
2013-12-17 02:43:14 -05:00
Josh Bleecher Snyder
4a18e0edd9 math/rand: minor optimization to Perm
Instead of writing out 0..n and then reading it
back, just use i when it is needed.

Wikipedia calls this the "inside-out" implementation:
http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle

This yields identical values to the previous
implementation, given the same seed. (Note that the
output from Example_rand is unchanged.)

2.8 GHz Intel Core i7, results very stable:

benchmark          old ns/op    new ns/op    delta
BenchmarkPerm3           138          136   -1.45%
BenchmarkPerm30          825          803   -2.67%

Stock Raspberry Pi, minimum improvement out of three runs:

benchmark          old ns/op    new ns/op    delta
BenchmarkPerm3          5774         5664   -1.91%
BenchmarkPerm30        32582        29381   -9.82%

R=golang-dev, dave, mtj, adg
CC=golang-dev
https://golang.org/cl/21030043
2013-12-17 13:49:34 +11:00
Marko Tiikkaja
1f20ab1116 database/sql: Check errors in QueryRow.Scan
The previous coding did not correctly check for errors from the driver's
Next() or Close(), which could mask genuine errors from the database, as
witnessed in issue #6651.

Even after this change errors from Close() will be ignored if the query
returned no rows (as Rows.Next will have closed the handle already), but it
is a lot easier for the drivers to guard against that.

Fixes #6651.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/41590043
2013-12-16 12:48:35 -08:00
David du Colombier
20dee338c3 net: lookup protocol in lower-case on Plan 9
Protocol keywords are case-insensitive,
but the Ndb database is case-sensitive.

Also use the generic net protocol instead
of tcp in lookupHost.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/40600047
2013-12-16 12:00:23 -08:00
Daniel Lidén
4e23b69314 strings: Add example function for IndexAny
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/42310044
2013-12-16 10:50:56 -08:00
Robin Eklind
ab9b2ae38c strings: Add IndexFunc example
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/42370043
2013-12-16 10:44:23 -08:00
Robin Eklind
7b53e32e0b strings: Update Trim example.
Use an input which better shows that behaviour of the function. Only leading
and trailing runes are trimed, not intermediate ones.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/42390043
2013-12-16 10:40:28 -08:00
Russ Cox
a392cf4fd3 runtime: fix test
Was supposed to be in the nm CL.

TBR=r
CC=golang-dev
https://golang.org/cl/42870043
2013-12-16 12:59:30 -05:00
Russ Cox
08b846b129 debug/goobj: add package for reading new Go object files
R=golang-dev, r, iant
CC=golang-dev
https://golang.org/cl/40610043
2013-12-16 12:52:21 -05:00
Robin Eklind
a6ebc88bac strings: Add FieldsFunc example.
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/42360043
2013-12-16 09:43:03 -08:00
Dave Cheney
62baae6e57 unicode/utf16: add explicit test for decoding invalid runes.
The EncodeRune test exercises DecodeRune, but only for runes that it can encode. Add an explicit test for invalid utf16 surrogate pairs.

Bonus: coverage is now 100%

unicode/utf16/utf16.go: IsSurrogate     100.0%
unicode/utf16/utf16.go: DecodeRune      100.0%
unicode/utf16/utf16.go: EncodeRune      100.0%
unicode/utf16/utf16.go: Encode          100.0%
unicode/utf16/utf16.go: Decode          100.0%
total:                  (statements)    100.0%

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/39150044
2013-12-16 12:35:25 +11:00
Dave Cheney
fb31a0b1d0 unicode/utf16: add explicit tests for IsSurrogate
Update #6956

Add tests for IsSurrogate.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/42570043
2013-12-16 11:15:23 +11:00
Adam Langley
1dabd71666 crypto/tls: generate random serial numbers.
NSS (used in Firefox and Chrome) won't accept two certificates with the same
issuer and serial. But this causes problems with self-signed certificates
with a fixed serial number.

This change randomises the serial numbers in the certificates generated by
generate_cert.go.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/38290044
2013-12-15 12:57:57 -05:00
Adam Langley
1d546005af crypto/cipher: fix CFB mode.
a073d65e6f8c had a couple of bugs in the CFB mode that I missed in code review:
        1) The loop condition wasn't updated from the old version.
        2) It wasn't safe when src and dst aliased.

Fixes #6950.

R=golang-dev, hanwen
CC=golang-dev
https://golang.org/cl/42110043
2013-12-15 12:55:59 -05:00