1
0
mirror of https://github.com/golang/go synced 2024-09-25 01:10:13 -06:00
Commit Graph

11269 Commits

Author SHA1 Message Date
Andrew Gerrand
8bbe5ccb71 godoc: support canonical Paths in HTML metadata
Redirect to the canonical path when the old path is accessed.

R=gri
CC=golang-dev
https://golang.org/cl/5536061
2012-01-20 07:37:36 +11:00
Evan Shaw
5a1322a79f os: add ModeSticky
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5539063
2012-01-19 11:29:24 -08:00
Shenghou Ma
d888ab80a3 testing: do not recover example's panic
So as to give out stack trace for panic in examples.
        This behavior also matches the tests'.
        Fixes #2691.

R=golang-dev
CC=golang-dev
https://golang.org/cl/5554061
2012-01-19 10:19:33 -08:00
Olivier Duperray
e5c1f3870b pkg: Add & fix Copyright of "hand generated" files
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5554064
2012-01-19 10:14:56 -08:00
Brad Fitzpatrick
bc0139b4b3 exp/sql: rename NullableString to NullString and allow its use as a parameter
Prep for Issue 2699

R=rsc
CC=golang-dev
https://golang.org/cl/5536045
2012-01-19 09:27:45 -08:00
Robert Griesemer
9e5f62ac0c go/doc, godoc: don't shadow receiver
Fixes #2737.

R=bradfitz
CC=golang-dev
https://golang.org/cl/5553062
2012-01-19 08:52:53 -08:00
Christoph Hack
2a6b4e120a net/http: the documentation should call NewRequest with the right signature.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5554063
2012-01-19 06:11:02 -08:00
Adam Langley
a99e35b625 crypto/x509: remove explicit uses of rsa.
(Sending to r because of the API change.)

Over time we might want to add support for other key types.

While I was in the code, I also made the use of RawSubject the same
between Subject and Issuer when creating certificates.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5554049
2012-01-19 08:49:52 -05:00
Adam Langley
247799ce8a crypto/elliptic: add constant-time P224.
(Sending to r because of the API change.)

This change alters the API for crypto/elliptic to permit different
implementations in the future. This will allow us to add faster,
constant-time implementations of the standard curves without any more
API changes.

As a demonstration, it also adds a constant-time implementation of
P224. Since it's only 32-bit, it's actually only about 40% the speed
of the generic code on a 64-bit system.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5528088
2012-01-19 08:39:03 -05:00
Dmitriy Vyukov
f2f0059307 math/rand: decrease test duration in short mode
TestNonStandardNormalValues runs 1.5s,
the change reduces it to 0.2s in short mode.
The problem is with slow machines, emulators and dynamic tools.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5540065
2012-01-19 16:17:44 +04:00
Andrew Gerrand
3358a5068a godoc: add anchors to cmd documentation headings
Also, disable server-side generation of TOC for commands as they would
only ever show Overview. The JS does a better job (for now).

Fixes #2732.

R=gri, dsymonds
CC=golang-dev
https://golang.org/cl/5558046
2012-01-19 18:59:06 +11:00
Nigel Tao
b4829c1de6 html: in foreign content, check for HTML integration points in breakout
elements.

Pass tests10.dat, test 33:
<!DOCTYPE html><svg><desc><svg><ul>a

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <svg svg>
|       <svg desc>
|         <svg svg>
|         <ul>
|           "a"

Also pass test 34:
<!DOCTYPE html><p><svg><desc><p>

R=andybalholm, dsymonds
CC=golang-dev
https://golang.org/cl/5536048
2012-01-19 17:41:10 +11:00
Mikio Hara
d4fe9c6a9d encoding/json: fix comments, tweak tests for tag names
R=bradfitz
CC=golang-dev
https://golang.org/cl/5558047
2012-01-19 15:33:29 +09:00
Russ Cox
21d3721eb8 regexp: add SubexpNames
Fixes #2440.

R=r, dsymonds
CC=golang-dev
https://golang.org/cl/5559043
2012-01-19 01:24:01 -05:00
Mikio Hara
e3e93b0f43 syscall: fix plan9 build
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5532097
2012-01-19 14:52:28 +09:00
Andrew Gerrand
e547393fcc godoc: remove "need more packages?" link
Its need will be addressed in another way by the redesign.

Fixes #2719.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5536062
2012-01-19 15:00:27 +11:00
Stefan Nilsson
1de4931113 doc/codewalk: update urlpoll to use time.Duration.
R=adg
CC=golang-dev
https://golang.org/cl/5545061
2012-01-19 14:45:59 +11:00
Andrew Gerrand
885cbc3be4 A+C: add Stefan Nilsson's gmail account
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5541064
2012-01-19 14:44:21 +11:00
Robert Griesemer
c109705c6f go/doc: collect imports
R=r
CC=golang-dev
https://golang.org/cl/5556051
2012-01-18 19:35:53 -08:00
Brad Fitzpatrick
f47807a57f cmd/go: skip _obj directories in package scans
Fixes #2693

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5557057
2012-01-18 19:27:16 -08:00
Mikio Hara
b58b5ba997 net: fix plan9 build
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5554058
2012-01-19 12:25:37 +09:00
Mikio Hara
2356e43827 net: fix comments
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5557059
2012-01-19 12:23:30 +09:00
Brad Fitzpatrick
f44304ee63 net/http: update the Client docs a bit
R=golang-dev, dsymonds, adg
CC=golang-dev
https://golang.org/cl/5557058
2012-01-18 19:05:53 -08:00
Brad Fitzpatrick
7d418aeed2 syscall: add Unix method to TimeSpec, TimeVal
Fixes #2534

R=golang-dev, dave, alex.brainman
CC=golang-dev
https://golang.org/cl/5554057
2012-01-18 19:05:44 -08:00
Brad Fitzpatrick
b39c883e29 encoding/json: allow / and % in tag names
Fixes #2718

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5532095
2012-01-18 19:05:15 -08:00
Sanjay Menakuru
0d8c6b4fcd path: added examples
R=rsc, adg
CC=golang-dev
https://golang.org/cl/5503089
2012-01-19 13:28:25 +11:00
Nigel Tao
af08cfa494 image: add PixOffset methods; use them in image/draw and image/tiff.
image/draw benchmarks show <1% change for the fast paths.
The slow paths got worse by 1-4%, but they're the slow paths.
I don't care so much about them, and presumably compiler improvements
could claw it back.

IIUC 6g's inlining is enabled by default now.

benchmark                        old ns/op    new ns/op    delta
draw.BenchmarkFillOver             2988384      2999624   +0.38%
draw.BenchmarkFillSrc               153141       153262   +0.08%
draw.BenchmarkCopyOver             2155756      2170831   +0.70%
draw.BenchmarkCopySrc                72591        72646   +0.08%
draw.BenchmarkNRGBAOver            2487372      2491576   +0.17%
draw.BenchmarkNRGBASrc             1361306      1409180   +3.52%
draw.BenchmarkYCbCr                2540712      2562359   +0.85%
draw.BenchmarkGlyphOver            1004879      1023308   +1.83%
draw.BenchmarkRGBA                 8746670      8844455   +1.12%
draw.BenchmarkGenericOver         31860960     32512960   +2.05%
draw.BenchmarkGenericMaskOver     16369060     16435720   +0.41%
draw.BenchmarkGenericSrc          13128540     13127810   -0.01%
draw.BenchmarkGenericMaskSrc      30059300     28883210   -3.91%

R=r, gri
CC=golang-dev, rsc
https://golang.org/cl/5536059
2012-01-19 12:59:39 +11:00
Brad Fitzpatrick
98af38807e net: use NewTimer, not NewTicker, in fd_windows.go
It works with NewTicker too, but is potentially a bit less efficient,
and reads wrong.

This is what happens when you TBR Windows changes, I guess.

R=golang-dev, gri, iant
CC=golang-dev
https://golang.org/cl/5536060
2012-01-18 16:49:59 -08:00
Andrew Gerrand
7cb21a79a4 godoc: specify HTML page metadata with a JSON blob
This allows HTML pages to specify arbitrary data in a header:

<!--{
        "Title": "The page title",
        ...
}-->

replacing the old style comments:

<!-- title The page title -->

R=gri, rsc, r, bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/5532093
2012-01-19 11:24:54 +11:00
Brad Fitzpatrick
b71883e9b0 net: change SetTimeout to SetDeadline
Previously, a timeout (in int64 nanoseconds) applied to a granularity
even smaller than one operation:  a 100 byte read with a 1 second timeout
could take 100 seconds, if the bytes all arrived on the network 1 second
apart.  This was confusing.

Rather than making the timeout granularity be per-Read/Write,
this CL makes callers set an absolute deadline (in time.Time)
after which operations will fail.  This makes it possible to
set deadlines at higher levels, without knowing exactly how
many read/write operations will happen in e.g. reading an HTTP
request.

Fixes #2723

R=r, rsc, dave
CC=golang-dev
https://golang.org/cl/5555048
2012-01-18 16:24:06 -08:00
Ian Lance Taylor
5e77b009d0 test: split golden.out into expected output per test
This will permit gccgo to check test output.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5554056
2012-01-18 16:12:24 -08:00
Robert Griesemer
eaf8295f3d fix windows build: always use / in filenames of go/doc test output
R=r
CC=golang-dev
https://golang.org/cl/5554055
2012-01-18 14:59:58 -08:00
Robert Griesemer
0203fbee64 doc/go1.*: documented changes to go/* package tree
R=r
CC=golang-dev
https://golang.org/cl/5557053
2012-01-18 14:35:23 -08:00
Benny Siegert
be93207c8f image/color: rename modelYCbCr to yCbCrModel.
This matches the other color models. It seems that this was missed
during the review of 5544073.

R=nigeltao, david.crawshaw
CC=golang-dev
https://golang.org/cl/5536057
2012-01-19 09:34:37 +11:00
Ian Lance Taylor
f203093852 test: change several tests to not print
This will make these tests more meaningful for gccgo, which
runs tests in parallel and has no equivalent to golden.out.

Remove ken/simpprint.go since it duplicates helloworld.go.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5536058
2012-01-18 14:31:31 -08:00
Robert Griesemer
39bb4bd454 go/doc: rewrote and completed test framework
Packages to test are kept in ./testdata together
with the corresponding golden (packagename.out)
file.

To update the golden files, run: go test -update

R=rsc
CC=golang-dev
https://golang.org/cl/5543054
2012-01-18 14:11:31 -08:00
Robert Griesemer
9edabbe038 go/token: replaced Files() with Iterate()
- Use a faster closure-based iterator rather than a channel-based one.
- Otherwise: better code organization, but no other API changes.

R=r, r
CC=golang-dev
https://golang.org/cl/5557051
2012-01-18 14:10:42 -08:00
Ian Lance Taylor
6b3462820f test: gofmt a few tests
I'm planning to change these tests, but the gofmt changes are
fairly extensive, so I'm separating the gofmt changes from the
substantive changes.

R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/5557052
2012-01-18 13:20:55 -08:00
Sameer Ajmani
20812c4907 time: add Since, which returns the time elapsed since some past time t.
R=rsc, r
CC=golang-dev
https://golang.org/cl/5532088
2012-01-18 15:25:00 -05:00
Adam Langley
dbebb08601 exp/ssh: handle versions with just '\n'
djm recommend that we do this because OpenSSL was only fixed in 2008:
http://anoncvs.mindrot.org/index.cgi/openssh/sshd.c?revision=1.380&view=markup

R=dave, jonathan.mark.pittman
CC=golang-dev
https://golang.org/cl/5555044
2012-01-18 15:04:17 -05:00
Shenghou Ma
18de11479c crypto/tls: add FreeBSD root certificate location
Fixes #2721.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5532090
2012-01-18 10:03:00 -08:00
Olivier Duperray
dcc5fe1e20 pkg/bytes: add the usual copyright notice to example_test.go
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5553050
2012-01-18 09:40:50 -08:00
Olivier Duperray
90c38c46af go/scanner: fix example
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5532085
2012-01-18 09:33:50 -08:00
Luuk van Dijk
6ff01f01f4 gc: fieldnames in structliterals in exported inlines should not be qualified if they're embedded builtin types.
Trust me.
Fixes #2687.

R=rsc
CC=golang-dev
https://golang.org/cl/5545047
2012-01-18 17:51:28 +01:00
Russ Cox
1f1c9baf78 doc/go1.html: add notes about hash.Hash
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5536053
2012-01-18 10:36:43 -05:00
Luit van Drongelen
a5263c7caa crypto/hmac: Add HMAC-SHA224 and HMAC-SHA384/512
First was, apart from adding tests, a single line of code (to add the
constructor function). Adding SHA512-based hashing to crypto/hmac
required minor rework of the package because of a previously hardcoded
block-size in it's implementation. Instead of using a hash.Hash
generator function the constructor function now uses a crypto.Hash
type, which was extended to expose information about block size.

The only standard library package impacted by the change is
crypto/tls, for which the fix is included in this patch. It might be
useful to extend gofix to include this API change too.

R=agl, r, rsc, r
CC=golang-dev
https://golang.org/cl/5550043
2012-01-18 10:36:28 -05:00
Luuk van Dijk
18ee75ec88 gc: handle printing of string/arrayrune conversions
Fixes #2714.

R=rsc
CC=golang-dev
https://golang.org/cl/5540066
2012-01-18 09:52:16 +01:00
Alex Brainman
436b37d885 os: remove old note about NewSyscallError being special
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5556044
2012-01-18 16:59:40 +11:00
Ian Lance Taylor
6a5db20d14 test: match gccgo error messages for bug345
bug345.dir/main.go:25:18: error: argument 1 has incompatible type (need explicit conversion; missing method ‘Write’)
bug345.dir/main.go:27:8: error: argument 1 has incompatible type

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5556043
2012-01-17 18:00:34 -08:00
Ian Lance Taylor
24c76f68ed test: fix bug364 to actually run
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5536044
2012-01-17 18:00:11 -08:00