]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agogo/ast: respect ImportSpec.EndPos
Scott Lawrence [Fri, 20 Jan 2012 18:34:19 +0000 (13:34 -0500)]
go/ast: respect ImportSpec.EndPos

Fixes #2566.

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

13 years agogo/doc: avoid the name 'a.out' in the testdata
Russ Cox [Fri, 20 Jan 2012 18:34:11 +0000 (13:34 -0500)]
go/doc: avoid the name 'a.out' in the testdata

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

13 years agogoyacc: fix indexing bug when yydebug >= 2
Rob Pike [Fri, 20 Jan 2012 18:22:41 +0000 (10:22 -0800)]
goyacc: fix indexing bug when yydebug >= 2
Fixes #2701.

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

13 years agomisc/xcode/go.xclangspec: fix typo
Shenghou Ma [Fri, 20 Jan 2012 15:17:52 +0000 (07:17 -0800)]
misc/xcode/go.xclangspec: fix typo

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

13 years agoruntime: add type algorithms for zero-sized types
Dmitriy Vyukov [Fri, 20 Jan 2012 06:32:55 +0000 (10:32 +0400)]
runtime: add type algorithms for zero-sized types
BenchmarkChanSem old=127ns new=78.6ns

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

13 years agotag weekly.2012-01-20
Nigel Tao [Fri, 20 Jan 2012 06:01:55 +0000 (17:01 +1100)]
tag weekly.2012-01-20

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

13 years agoweekly.2012-01-20 weekly.2012-01-20
Nigel Tao [Fri, 20 Jan 2012 05:57:10 +0000 (16:57 +1100)]
weekly.2012-01-20

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

13 years agonet: fix linux build
Mikio Hara [Fri, 20 Jan 2012 02:56:17 +0000 (18:56 -0800)]
net: fix linux build

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

13 years agomisc/cgo/test: make tests run on windows
Alex Brainman [Fri, 20 Jan 2012 01:59:44 +0000 (12:59 +1100)]
misc/cgo/test: make tests run on windows

- use proper Win64 gcc calling convention when
  calling initcgo on amd64
- increase g0 stack size to 64K on amd64 to make
  it the same as 386
- implement C.sleep
- do not use C.stat, since it is renamed to C._stat by mingw
- use fopen to implement TestErrno, since C.strtol
  always succeeds on windows
- skip TestSetEnv on windows, because os.Setenv
  sets windows process environment, while C.getenv
  inspects internal C runtime variable instead

R=golang-dev, vcc.163, rsc
CC=golang-dev
https://golang.org/cl/5500094

13 years agodatabase/sql: move from exp/sql
Brad Fitzpatrick [Fri, 20 Jan 2012 00:04:26 +0000 (16:04 -0800)]
database/sql: move from exp/sql

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

13 years agohtml/template: fix docs after API changes
Gustavo Niemeyer [Thu, 19 Jan 2012 23:49:28 +0000 (21:49 -0200)]
html/template: fix docs after API changes

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

13 years agoos: use FileMode instead of uint32 in various functions
Brad Fitzpatrick [Thu, 19 Jan 2012 23:45:18 +0000 (15:45 -0800)]
os: use FileMode instead of uint32 in various functions

Fixes #2733

R=chickencha, ality, rsc
CC=golang-dev
https://golang.org/cl/5553064

13 years agoimage: change the YCbCr image's pixel buffers to start at Rect.Min
Nigel Tao [Thu, 19 Jan 2012 23:44:22 +0000 (10:44 +1100)]
image: change the YCbCr image's pixel buffers to start at Rect.Min
instead of the origin.

This makes YCbCr match the other image types (e.g. RGBA, Gray) in
that an image's bounds is not restricted to the positive quadrant.

Also optimize the YCbCr draw code by hoisting some computation
outside of the loop.

benchmark              old ns/op    new ns/op    delta
draw.BenchmarkYCbCr      2544418      2373558   -6.72%

Like https://golang.org/cl/4681044/ I don't think a gofix is
feasible. People will have to make manual changes. On the other hand,
directly manipulating YCbCr images is relatively rare, compared to
RGBA images, and if other code just uses the jpeg and draw packages
instead of messing directly with a YCbCr's []byte representations,
then things should just continue to work.

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

13 years agonet: fix windows build
Mikio Hara [Thu, 19 Jan 2012 23:33:37 +0000 (08:33 +0900)]
net: fix windows build

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

13 years agonet: fix broken setDefaultSockopts
Mikio Hara [Thu, 19 Jan 2012 22:31:13 +0000 (07:31 +0900)]
net: fix broken setDefaultSockopts

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

13 years agocrypto/hmac: Deprecate hmac.NewMD5, hmac.NewSHA1 and hmac.NewSHA256
Luit van Drongelen [Thu, 19 Jan 2012 22:28:38 +0000 (17:28 -0500)]
crypto/hmac: Deprecate hmac.NewMD5, hmac.NewSHA1 and hmac.NewSHA256

Remove NewMD5, NewSHA1 and NewSHA256 in favor of using New and
explicitly importing the used hash-function. This way when using, for
example, HMAC with RIPEMD there's no md5, sha1 and sha256 linked in
through the hmac package.

A gofix rule is included, and applied to the standard library (3 files
altered).

This change is the result of a discussion at
https://golang.org/cl/5550043/ to pull the discussion about
deprecating these functions out of that issue.

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

13 years agogc: don't emit pkgpath for error type.
David Symonds [Thu, 19 Jan 2012 22:26:17 +0000 (09:26 +1100)]
gc: don't emit pkgpath for error type.

Fixes #2660.

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

13 years agonet/http: log handler panic before closing HTTP connection
Brad Fitzpatrick [Thu, 19 Jan 2012 22:19:59 +0000 (14:19 -0800)]
net/http: log handler panic before closing HTTP connection

Fix originally from rogpeppe in 5414048 but was rolled
back due to test breakage.

This CL makes the test more robust to order of operations.

Fixes #2480 again.

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

13 years agoos/exec: trivial allocation removal in LookPath
Gustavo Niemeyer [Thu, 19 Jan 2012 22:17:46 +0000 (20:17 -0200)]
os/exec: trivial allocation removal in LookPath

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

13 years agoencoding/xml: marshal/unmarshal xml.Name in field
Gustavo Niemeyer [Thu, 19 Jan 2012 22:15:55 +0000 (20:15 -0200)]
encoding/xml: marshal/unmarshal xml.Name in field

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

13 years agodoc: update out-of-date comments about runtime/cgo
Shenghou Ma [Thu, 19 Jan 2012 22:13:33 +0000 (17:13 -0500)]
doc: update out-of-date comments about runtime/cgo

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

13 years agogo/parser: expressions may have comments
Robert Griesemer [Thu, 19 Jan 2012 21:54:31 +0000 (13:54 -0800)]
go/parser: expressions may have comments

Thanks to 0xE2.0x9A.0x9B for the patch suggestion.

Fixes #2739.

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

13 years agotext/template/parse: use human error prints
Rob Pike [Thu, 19 Jan 2012 21:51:37 +0000 (13:51 -0800)]
text/template/parse: use human error prints
The previous version of all the node.String methods printed the parse
tree and was useful for developing the parse tree code. Now that that's done,
we might as well print the nodes using the standard template syntax.
It's much easier to read and makes error reporting look more natural.

Helps issue 2644.

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

13 years agoruntime: madvise and SysUnused for Darwin
Dave Cheney [Thu, 19 Jan 2012 20:51:29 +0000 (15:51 -0500)]
runtime: madvise and SysUnused for Darwin

SysUnused is a direct call to madvise MADV_FREE.

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

13 years agogodoc: support canonical Paths in HTML metadata
Andrew Gerrand [Thu, 19 Jan 2012 20:37:36 +0000 (07:37 +1100)]
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

13 years agoos: add ModeSticky
Evan Shaw [Thu, 19 Jan 2012 19:29:24 +0000 (11:29 -0800)]
os: add ModeSticky

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

13 years agotesting: do not recover example's panic
Shenghou Ma [Thu, 19 Jan 2012 18:19:33 +0000 (10:19 -0800)]
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

13 years agopkg: Add & fix Copyright of "hand generated" files
Olivier Duperray [Thu, 19 Jan 2012 18:14:56 +0000 (10:14 -0800)]
pkg: Add & fix Copyright of "hand generated" files

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

13 years agoexp/sql: rename NullableString to NullString and allow its use as a parameter
Brad Fitzpatrick [Thu, 19 Jan 2012 17:27:45 +0000 (09:27 -0800)]
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

13 years agogo/doc, godoc: don't shadow receiver
Robert Griesemer [Thu, 19 Jan 2012 16:52:53 +0000 (08:52 -0800)]
go/doc, godoc: don't shadow receiver

Fixes #2737.

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

13 years agonet/http: the documentation should call NewRequest with the right signature.
Christoph Hack [Thu, 19 Jan 2012 14:11:02 +0000 (06:11 -0800)]
net/http: the documentation should call NewRequest with the right signature.

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

13 years agocrypto/x509: remove explicit uses of rsa.
Adam Langley [Thu, 19 Jan 2012 13:49:52 +0000 (08:49 -0500)]
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

13 years agocrypto/elliptic: add constant-time P224.
Adam Langley [Thu, 19 Jan 2012 13:39:03 +0000 (08:39 -0500)]
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

13 years agomath/rand: decrease test duration in short mode
Dmitriy Vyukov [Thu, 19 Jan 2012 12:17:44 +0000 (16:17 +0400)]
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

13 years agogodoc: add anchors to cmd documentation headings
Andrew Gerrand [Thu, 19 Jan 2012 07:59:06 +0000 (18:59 +1100)]
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

13 years agohtml: in foreign content, check for HTML integration points in breakout
Nigel Tao [Thu, 19 Jan 2012 06:41:10 +0000 (17:41 +1100)]
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

13 years agoencoding/json: fix comments, tweak tests for tag names
Mikio Hara [Thu, 19 Jan 2012 06:33:29 +0000 (15:33 +0900)]
encoding/json: fix comments, tweak tests for tag names

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

13 years agoregexp: add SubexpNames
Russ Cox [Thu, 19 Jan 2012 06:24:01 +0000 (01:24 -0500)]
regexp: add SubexpNames

Fixes #2440.

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

13 years agosyscall: fix plan9 build
Mikio Hara [Thu, 19 Jan 2012 05:52:28 +0000 (14:52 +0900)]
syscall: fix plan9 build

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

13 years agogodoc: remove "need more packages?" link
Andrew Gerrand [Thu, 19 Jan 2012 04:00:27 +0000 (15:00 +1100)]
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

13 years agodoc/codewalk: update urlpoll to use time.Duration.
Stefan Nilsson [Thu, 19 Jan 2012 03:45:59 +0000 (14:45 +1100)]
doc/codewalk: update urlpoll to use time.Duration.

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

13 years agoA+C: add Stefan Nilsson's gmail account
Andrew Gerrand [Thu, 19 Jan 2012 03:44:21 +0000 (14:44 +1100)]
A+C: add Stefan Nilsson's gmail account

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

13 years agogo/doc: collect imports
Robert Griesemer [Thu, 19 Jan 2012 03:35:53 +0000 (19:35 -0800)]
go/doc: collect imports

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

13 years agocmd/go: skip _obj directories in package scans
Brad Fitzpatrick [Thu, 19 Jan 2012 03:27:16 +0000 (19:27 -0800)]
cmd/go: skip _obj directories in package scans

Fixes #2693

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

13 years agonet: fix plan9 build
Mikio Hara [Thu, 19 Jan 2012 03:25:37 +0000 (12:25 +0900)]
net: fix plan9 build

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

13 years agonet: fix comments
Mikio Hara [Thu, 19 Jan 2012 03:23:30 +0000 (12:23 +0900)]
net: fix comments

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

13 years agonet/http: update the Client docs a bit
Brad Fitzpatrick [Thu, 19 Jan 2012 03:05:53 +0000 (19:05 -0800)]
net/http: update the Client docs a bit

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

13 years agosyscall: add Unix method to TimeSpec, TimeVal
Brad Fitzpatrick [Thu, 19 Jan 2012 03:05:44 +0000 (19:05 -0800)]
syscall: add Unix method to TimeSpec, TimeVal

Fixes #2534

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

13 years agoencoding/json: allow / and % in tag names
Brad Fitzpatrick [Thu, 19 Jan 2012 03:05:15 +0000 (19:05 -0800)]
encoding/json: allow / and % in tag names

Fixes #2718

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

13 years agopath: added examples
Sanjay Menakuru [Thu, 19 Jan 2012 02:28:25 +0000 (13:28 +1100)]
path: added examples

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

13 years agoimage: add PixOffset methods; use them in image/draw and image/tiff.
Nigel Tao [Thu, 19 Jan 2012 01:59:39 +0000 (12:59 +1100)]
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

13 years agonet: use NewTimer, not NewTicker, in fd_windows.go
Brad Fitzpatrick [Thu, 19 Jan 2012 00:49:59 +0000 (16:49 -0800)]
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

13 years agogodoc: specify HTML page metadata with a JSON blob
Andrew Gerrand [Thu, 19 Jan 2012 00:24:54 +0000 (11:24 +1100)]
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

13 years agonet: change SetTimeout to SetDeadline
Brad Fitzpatrick [Thu, 19 Jan 2012 00:24:06 +0000 (16:24 -0800)]
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

13 years agotest: split golden.out into expected output per test
Ian Lance Taylor [Thu, 19 Jan 2012 00:12:24 +0000 (16:12 -0800)]
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

13 years agofix windows build: always use / in filenames of go/doc test output
Robert Griesemer [Wed, 18 Jan 2012 22:59:58 +0000 (14:59 -0800)]
fix windows build: always use / in filenames of go/doc test output

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

13 years agodoc/go1.*: documented changes to go/* package tree
Robert Griesemer [Wed, 18 Jan 2012 22:35:23 +0000 (14:35 -0800)]
doc/go1.*: documented changes to go/* package tree

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

13 years agoimage/color: rename modelYCbCr to yCbCrModel.
Benny Siegert [Wed, 18 Jan 2012 22:34:37 +0000 (09:34 +1100)]
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

13 years agotest: change several tests to not print
Ian Lance Taylor [Wed, 18 Jan 2012 22:31:31 +0000 (14:31 -0800)]
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

13 years agogo/doc: rewrote and completed test framework
Robert Griesemer [Wed, 18 Jan 2012 22:11:31 +0000 (14:11 -0800)]
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

13 years agogo/token: replaced Files() with Iterate()
Robert Griesemer [Wed, 18 Jan 2012 22:10:42 +0000 (14:10 -0800)]
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

13 years agotest: gofmt a few tests
Ian Lance Taylor [Wed, 18 Jan 2012 21:20:55 +0000 (13:20 -0800)]
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

13 years agotime: add Since, which returns the time elapsed since some past time t.
Sameer Ajmani [Wed, 18 Jan 2012 20:25:00 +0000 (15:25 -0500)]
time: add Since, which returns the time elapsed since some past time t.

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

13 years agoexp/ssh: handle versions with just '\n'
Adam Langley [Wed, 18 Jan 2012 20:04:17 +0000 (15:04 -0500)]
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

13 years agocrypto/tls: add FreeBSD root certificate location
Shenghou Ma [Wed, 18 Jan 2012 18:03:00 +0000 (10:03 -0800)]
crypto/tls: add FreeBSD root certificate location
    Fixes #2721.

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

13 years agopkg/bytes: add the usual copyright notice to example_test.go
Olivier Duperray [Wed, 18 Jan 2012 17:40:50 +0000 (09:40 -0800)]
pkg/bytes: add the usual copyright notice to example_test.go

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

13 years agogo/scanner: fix example
Olivier Duperray [Wed, 18 Jan 2012 17:33:50 +0000 (09:33 -0800)]
go/scanner: fix example

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

13 years agogc: fieldnames in structliterals in exported inlines should not be qualified if they...
Luuk van Dijk [Wed, 18 Jan 2012 16:51:28 +0000 (17:51 +0100)]
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

13 years agodoc/go1.html: add notes about hash.Hash
Russ Cox [Wed, 18 Jan 2012 15:36:43 +0000 (10:36 -0500)]
doc/go1.html: add notes about hash.Hash

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

13 years agocrypto/hmac: Add HMAC-SHA224 and HMAC-SHA384/512
Luit van Drongelen [Wed, 18 Jan 2012 15:36:28 +0000 (10:36 -0500)]
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

13 years agogc: handle printing of string/arrayrune conversions
Luuk van Dijk [Wed, 18 Jan 2012 08:52:16 +0000 (09:52 +0100)]
gc: handle printing of string/arrayrune conversions

Fixes #2714.

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

13 years agoos: remove old note about NewSyscallError being special
Alex Brainman [Wed, 18 Jan 2012 05:59:40 +0000 (16:59 +1100)]
os: remove old note about NewSyscallError being special

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

13 years agotest: match gccgo error messages for bug345
Ian Lance Taylor [Wed, 18 Jan 2012 02:00:34 +0000 (18:00 -0800)]
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

13 years agotest: fix bug364 to actually run
Ian Lance Taylor [Wed, 18 Jan 2012 02:00:11 +0000 (18:00 -0800)]
test: fix bug364 to actually run

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

13 years agoencoding/json: document angle bracket escaping.
David Symonds [Wed, 18 Jan 2012 01:56:24 +0000 (12:56 +1100)]
encoding/json: document angle bracket escaping.

Fixes #2643.

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

13 years agoimage: fix typo in Rectangle.Sub comment.
Nigel Tao [Tue, 17 Jan 2012 23:55:03 +0000 (10:55 +1100)]
image: fix typo in Rectangle.Sub comment.

Fixes #2724.

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

13 years agofmt: fix Malloc test
Rob Pike [Tue, 17 Jan 2012 23:42:02 +0000 (15:42 -0800)]
fmt: fix Malloc test
We need to avoid allocating an extra word for the interface value
passing the floating-point value as an interface{}. It's easy.

Fixes #2722.

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

13 years agoutf8.String: move to exp/utf8string.String
Rob Pike [Tue, 17 Jan 2012 22:21:50 +0000 (14:21 -0800)]
utf8.String: move to exp/utf8string.String

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

13 years agotesting: document examples
Rob Pike [Tue, 17 Jan 2012 22:20:27 +0000 (14:20 -0800)]
testing: document examples
The package documentation did not mention them.
They were described only in godoc for gotest, and that's going away.

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

13 years agonet/http: change test to use override param instead of chan.
David Symonds [Tue, 17 Jan 2012 21:28:09 +0000 (08:28 +1100)]
net/http: change test to use override param instead of chan.

Follow-on from https://golang.org/cl/5543062.

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

13 years agotext/template: fix nil error on redefinition
Rob Pike [Tue, 17 Jan 2012 21:24:59 +0000 (13:24 -0800)]
text/template: fix nil error on redefinition
Fixes #2720.

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

13 years agonet/http/cgi: increase a flaky test timeout
Brad Fitzpatrick [Tue, 17 Jan 2012 21:14:27 +0000 (13:14 -0800)]
net/http/cgi: increase a flaky test timeout

Fixes 2450, probably.

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

13 years agocmd/go: remove mentions of 'gotest' from the documentation
Rob Pike [Tue, 17 Jan 2012 21:13:50 +0000 (13:13 -0800)]
cmd/go: remove mentions of 'gotest' from the documentation
go test runs the tests itself; it does not run the gotest command,
so these mentions are confusing.

R=golang-dev, n13m3y3r
CC=golang-dev
https://golang.org/cl/5551043

13 years agocontainer/heap: better package documentation
Rob Pike [Tue, 17 Jan 2012 21:07:47 +0000 (13:07 -0800)]
container/heap: better package documentation
Fixes #1820.

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

13 years agomime: make FormatMediaType take full type for consistency
Brad Fitzpatrick [Tue, 17 Jan 2012 19:57:42 +0000 (11:57 -0800)]
mime: make FormatMediaType take full type for consistency

Fixes #2405

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

13 years agofmt: enable and fix malloc test
Rob Pike [Tue, 17 Jan 2012 18:45:36 +0000 (10:45 -0800)]
fmt: enable and fix malloc test
On 32-bit machines, %g takes an extra malloc. I don't know why yet,
but this makes the test pass again, and enables it even for -short.

Fixes #2653.

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

13 years agoexp/sql: copy when scanning into []byte by default
Brad Fitzpatrick [Tue, 17 Jan 2012 18:44:35 +0000 (10:44 -0800)]
exp/sql: copy when scanning into []byte by default

Fixes #2698

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

13 years agodoc/docs: fix broken links
Scott Lawrence [Tue, 17 Jan 2012 18:29:08 +0000 (10:29 -0800)]
doc/docs: fix broken links

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

13 years agodoc: I have modified the broken links.
Jongmin Kim [Tue, 17 Jan 2012 17:47:34 +0000 (09:47 -0800)]
doc: I have modified the broken links.

R=golang-dev, duperray.olivier, r
CC=adg, golang-dev
https://golang.org/cl/5542054

13 years agobuildscripts: move to buildscript directory
Shenghou Ma [Tue, 17 Jan 2012 16:18:15 +0000 (11:18 -0500)]
buildscripts: move to buildscript directory
        Fixes #2717.

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

13 years agogc: give esc.c's sink an orig so -mm diagnostics work again.
Luuk van Dijk [Tue, 17 Jan 2012 09:01:12 +0000 (10:01 +0100)]
gc: give esc.c's sink an orig so -mm diagnostics work again.

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

13 years agogc: fix infinite recursion for embedded interfaces
Luuk van Dijk [Tue, 17 Jan 2012 09:00:57 +0000 (10:00 +0100)]
gc: fix infinite recursion for embedded interfaces

Fixes #1909

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

13 years agoold/netchan: fix data race on client hashmap
Dmitriy Vyukov [Tue, 17 Jan 2012 07:48:20 +0000 (11:48 +0400)]
old/netchan: fix data race on client hashmap
Fixes #2713.

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

13 years agopkg: add missing godoc comments to windows versions
Alex Brainman [Tue, 17 Jan 2012 05:51:54 +0000 (16:51 +1100)]
pkg: add missing godoc comments to windows versions

Mostly copied comments from unix files.

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

13 years agogo/build: no back slash in FindTree returned pkg name
Alex Brainman [Tue, 17 Jan 2012 05:51:02 +0000 (16:51 +1100)]
go/build: no back slash in FindTree returned pkg name

Fixes #2652.

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

13 years agoexp/proxy: fix build after URL changes
Gustavo Niemeyer [Tue, 17 Jan 2012 02:55:35 +0000 (00:55 -0200)]
exp/proxy: fix build after URL changes

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

13 years agonet/url: cleaned up URL interface (v2)
Gustavo Niemeyer [Tue, 17 Jan 2012 02:49:05 +0000 (00:49 -0200)]
net/url: cleaned up URL interface (v2)

Duplicated fields from URL were dropped so that its behavior
is simple and expected when being stringified and when being
operated by packages like http. Most of the preserved fields
are in unencoded form, except for RawQuery which continues to
exist and be more easily handled via url.Query().

The RawUserinfo field was also replaced since it wasn't practical
to use and had limitations when operating with empty usernames
and passwords which are allowed by the RFC. In its place the
Userinfo type was introduced and made accessible through the
url.User and url.UserPassword functions.

What was previous built as:

        url.URL{RawUserinfo: url.EncodeUserinfo("user", ""), ...}

Is now built as:

        url.URL{User: url.User("user"), ...}

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

13 years agonet: fix unintentional error variable shadowing
Mikio Hara [Tue, 17 Jan 2012 01:59:39 +0000 (10:59 +0900)]
net: fix unintentional error variable shadowing

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

13 years ago5l: remove redundant code
Shenghou Ma [Tue, 17 Jan 2012 00:29:54 +0000 (19:29 -0500)]
5l: remove redundant code
        5l/asm.c: code in line 311-319 has already outputed segtext.sect->next;

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

13 years agomath/rand: document default initial seed for global generator
Scott Lawrence [Mon, 16 Jan 2012 23:13:34 +0000 (18:13 -0500)]
math/rand: document default initial seed for global generator

Fixes #2044.

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