]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
13 years agoweekly.2011-06-02 weekly.2011-06-02
Andrew Gerrand [Fri, 3 Jun 2011 01:18:34 +0000 (11:18 +1000)]
weekly.2011-06-02

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

13 years agodoc: add Belarusian FAQ translation
Andrew Gerrand [Thu, 2 Jun 2011 23:48:42 +0000 (09:48 +1000)]
doc: add Belarusian FAQ translation

R=golang-dev, dchest
CC=golang-dev
https://golang.org/cl/4564057

13 years agofmt: fix bug in UnreadRune: must clear memory of previous
Rob Pike [Thu, 2 Jun 2011 21:53:50 +0000 (07:53 +1000)]
fmt: fix bug in UnreadRune: must clear memory of previous
rune if input implements UnreadRune; otherwise the lookahead
will lie.

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

13 years agoexec: change exec.PathError to exec.Error
Rob Pike [Thu, 2 Jun 2011 21:48:06 +0000 (07:48 +1000)]
exec: change exec.PathError to exec.Error
There were two issues:
1) It might not be a path error, it might be 'permission denied'.
2) The concept of $PATH is Unix-specific.

R=alex.brainman, rsc, r, mattn.jp
CC=golang-dev
https://golang.org/cl/4530096

13 years agohttp: ServeFile shouldn't send Content-Length when Content-Encoding is set
Brad Fitzpatrick [Thu, 2 Jun 2011 20:36:52 +0000 (13:36 -0700)]
http: ServeFile shouldn't send Content-Length when Content-Encoding is set

Fixes #1905

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

13 years agobig: remove some unnecessary conversions
Robert Griesemer [Thu, 2 Jun 2011 19:58:26 +0000 (12:58 -0700)]
big: remove some unnecessary conversions

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

13 years agohttp: catch panics
Brad Fitzpatrick [Thu, 2 Jun 2011 19:00:26 +0000 (12:00 -0700)]
http: catch panics

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

13 years agobig: do not modify divisor
Robert Griesemer [Thu, 2 Jun 2011 18:07:41 +0000 (11:07 -0700)]
big: do not modify divisor

Fixes #1907.

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

13 years agoexec: add Cmd methods StdinPipe, StdoutPipe, StderrPipe
Brad Fitzpatrick [Thu, 2 Jun 2011 17:26:09 +0000 (10:26 -0700)]
exec: add Cmd methods StdinPipe, StdoutPipe, StderrPipe

It gets annoying to do this in caller code otherwise,
especially having to remember to Close one side.

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

13 years agosync/atomic: fix check64
Russ Cox [Thu, 2 Jun 2011 17:13:51 +0000 (13:13 -0400)]
sync/atomic: fix check64

The LDREXD and STREXD instructions require
aligned addresses, and the ARM stack is not
guaranteed to be aligned during the check.
This may cause other problems later (on the ARM
not all 64-bit pointers may be 64-bit aligned)
but at least the check is correct now.

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

13 years agoexec: missing docs, errors
Brad Fitzpatrick [Thu, 2 Jun 2011 16:57:24 +0000 (09:57 -0700)]
exec: missing docs, errors

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

13 years agogc: typecheck the whole tree before walking. preparation for some escape-analysis...
Luuk van Dijk [Thu, 2 Jun 2011 16:48:17 +0000 (18:48 +0200)]
gc: typecheck the whole tree before walking.  preparation for some escape-analysis related changes.

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

13 years agopath/filepath: skip permission test in all.bash
Russ Cox [Thu, 2 Jun 2011 16:26:43 +0000 (12:26 -0400)]
path/filepath: skip permission test in all.bash

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

13 years agotesting: fix MB/s computation, documentation
Dmitriy Vyukov [Thu, 2 Jun 2011 14:52:46 +0000 (10:52 -0400)]
testing: fix MB/s computation, documentation

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

13 years agonet, syscall: update IP multicast socket options for darwin, freebsd, linux
Mikio Hara [Thu, 2 Jun 2011 14:10:17 +0000 (10:10 -0400)]
net, syscall: update IP multicast socket options for darwin, freebsd, linux

Add IPv6Mreq and Inet6Pktinfo for specifying the network interface.
Rename IpMreq to IPMreq, SetsockoptIpMreq to SetsockoptIPMreq.

R=rsc, dave, robert.hencke
CC=golang-dev
https://golang.org/cl/4532098

13 years agotemplate: explain that fields must be exported.
Rob Pike [Thu, 2 Jun 2011 14:09:42 +0000 (00:09 +1000)]
template: explain that fields must be exported.
Fixes #1792.

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

13 years agocompress/flate: do not use background goroutines
Russ Cox [Thu, 2 Jun 2011 13:32:38 +0000 (09:32 -0400)]
compress/flate: do not use background goroutines

Programs expect that Read and Write are synchronous.
The background goroutines make the implementation
a little easier, but they introduce asynchrony that
trips up calling code.  Remove them.

R=golang-dev, krasin
CC=golang-dev
https://golang.org/cl/4548079

13 years agoimage: add a SubImage method.
Nigel Tao [Thu, 2 Jun 2011 08:51:41 +0000 (18:51 +1000)]
image: add a SubImage method.

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

13 years agoruntime: do not garbage collect windows callbacks
Alex Brainman [Thu, 2 Jun 2011 07:08:56 +0000 (17:08 +1000)]
runtime: do not garbage collect windows callbacks

Fixes #1883.
Fixes #1702.

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

13 years agodoc: add link to App Engine docs to front page
Andrew Gerrand [Thu, 2 Jun 2011 01:00:24 +0000 (11:00 +1000)]
doc: add link to App Engine docs to front page

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

13 years agofmt: return EOF when out of input in Scan*.
Rob Pike [Thu, 2 Jun 2011 00:51:31 +0000 (10:51 +1000)]
fmt: return EOF when out of input in Scan*.
Fixes #1840.

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

13 years agohttp/spdy: reorganize package.
William Chan [Thu, 2 Jun 2011 00:30:49 +0000 (17:30 -0700)]
http/spdy: reorganize package.

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

13 years agosync: always wake up previously sleeping goroutines on Cond.Signal
Gustavo Niemeyer [Wed, 1 Jun 2011 23:30:42 +0000 (20:30 -0300)]
sync: always wake up previously sleeping goroutines on Cond.Signal

This changes the internal implementation of Cond so that
it uses two generations of waiters.  This enables Signal
to guarantee that it will only wake up waiters that are
currently sleeping at the call time.

Fixes #1648.

R=dvyukov, gustavo, rsc
CC=golang-dev
https://golang.org/cl/4524083

13 years agobig: fix broken overflow test
Robert Griesemer [Wed, 1 Jun 2011 23:28:17 +0000 (16:28 -0700)]
big: fix broken overflow test

- tested with GOARCH=386
- tested with GOARCH=amd64

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

13 years agoexec: new API, replace Run with Command
Brad Fitzpatrick [Wed, 1 Jun 2011 22:26:53 +0000 (15:26 -0700)]
exec: new API, replace Run with Command

This removes exec.Run and replaces exec.Cmd with a
new implementation. The new exec.Cmd represents
both a currently-running command and also a command
being prepared. It has a good zero value.

You can Start + Wait on a Cmd, or simply Run it.
Start (and Run) deal with copying stdout, stdin,
and stderr between the Cmd's io.Readers and
io.Writers.

There are convenience methods to capture a command's
stdout and/or stderr.

R=r, n13m3y3r, rsc, gustavo, alex.brainman, dsymonds, r, adg, duzy.chan, mike.rosset, kevlar
CC=golang-dev
https://golang.org/cl/4552052

13 years agofix build: remove non-portable test case
Robert Griesemer [Wed, 1 Jun 2011 22:19:34 +0000 (15:19 -0700)]
fix build: remove non-portable test case

On a 32bit machine, the big.Words are only 32bit.

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

13 years agogodoc: basic setup for running godoc on local app engine emulator
Robert Griesemer [Wed, 1 Jun 2011 22:12:47 +0000 (15:12 -0700)]
godoc: basic setup for running godoc on local app engine emulator

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

13 years agobig: ~8x faster number scanning
Robert Griesemer [Wed, 1 Jun 2011 21:17:00 +0000 (14:17 -0700)]
big: ~8x faster number scanning

- better number scanning algorithm
- fixed a couple of bugs related to base interpretation
- added scan benchmark
- added more test cases and made tests more precise
- introduced Int.scan method matching nat.scan
- refactored Int.Scan; now uses int.scan
- refactored Int.SetString; now uses int.scan

There is more potential, this was a fairly simple change.

gotest -test.bench="ScanPi" before/after (best of 3 runs):
big.BenchmarkScanPi    1000     2024900 ns/op
big.BenchmarkScanPi       10000      257540 ns/op

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

13 years agoundo CL 4557058 / b4c2ffae7034
Russ Cox [Wed, 1 Jun 2011 19:49:57 +0000 (15:49 -0400)]
undo CL 4557058 / b4c2ffae7034

Using the getaddrinfo order is only okay if we
are smart enough to try multiple addresses in Dial.
Since the code does not do that, we must make
the right first choice, regardless of what getaddrinfo
does, and more often that not that means using the
IPv4 address, even on IPv6 systems.  With the CL
applied, gotest fails in package net on OS X.

helix.cam=; gotest
...
--- FAIL: net.TestDialGoogleIPv4 (1.05 seconds)
        -- 74.125.226.179:80 --
        -- www.google.com:80 --
        Dial("tcp", "", "www.google.com:80") = _, dial tcp [2001:4860:800f::69]:80: address family not supported by protocol family
        -- 74.125.226.179:http --
        -- www.google.com:http --
        Dial("tcp", "", "www.google.com:http") = _, dial tcp [2001:4860:800f::69]:80: address family not supported by protocol family
        -- 074.125.226.179:0080 --
        -- [::ffff:74.125.226.179]:80 --
        -- [::ffff:4a7d:e2b3]:80 --
        -- [0:0:0:0:0000:ffff:74.125.226.179]:80 --
        -- [0:0:0:0:000000:ffff:74.125.226.179]:80 --
        -- [0:0:0:0:0:ffff::74.125.226.179]:80 --
FAIL
gotest: "./6.out" failed: exit status 1

««« original CL description
net: name-based destination address selection

getaddrinfo() orders the addresses according to RFC 3484.

This means when IPv6 is working on a host we get results like:
    []string = {"2001:4810::110", "66.117.47.214"}

and when it's not working we get:
    []string = {"66.117.47.214", "2001:4810::110"}

thus can drop firstFavoriteAddr.

This also means /etc/gai.conf works on relevant systems.

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

»»»

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

13 years agocrypto/openpgp: add support for symmetrically encrypting files.
Adam Langley [Wed, 1 Jun 2011 19:23:22 +0000 (15:23 -0400)]
crypto/openpgp: add support for symmetrically encrypting files.

This mostly adds the infrastructure for writing various forms of
packets as well as reading them. Adding symmetric encryption support
was simply an easy motivation.

There's also one brown-paper-bag fix in here. Previously I had the
conditional for the MDC hash check backwards: the code was checking
that the hash was *incorrect*. This was neatly counteracted by another
bug: it was hashing the ciphertext of the OCFB prefix, not the
plaintext.

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

13 years agoasn1: fix marshalling of empty optional RawValues
Mikkel Krautz [Wed, 1 Jun 2011 16:54:16 +0000 (12:54 -0400)]
asn1: fix marshalling of empty optional RawValues

This fixes creation of X509 certificates with
RSA keys. (Broken by e5ecc416f2fd)

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

13 years agogc: make merely referencing an outer variable in a closure not force heapallocation.
Luuk van Dijk [Wed, 1 Jun 2011 15:02:43 +0000 (17:02 +0200)]
gc: make merely referencing an outer variable in a closure not force heapallocation.

before: runtime_test.BenchmarkCallClosure1       20000000              135 ns/op
after:  runtime_test.BenchmarkCallClosure1      500000000                6 ns/op

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

13 years agopath/filepath: clean up a triple negative.
Rob Pike [Wed, 1 Jun 2011 04:17:09 +0000 (14:17 +1000)]
path/filepath: clean up a triple negative.
also make the error prints better in the test.

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

13 years agomail: new package.
David Symonds [Wed, 1 Jun 2011 04:10:21 +0000 (14:10 +1000)]
mail: new package.

Basic parsing, plus date parsing.

R=bradfitz, gary.burd, bsiegert, rsc
CC=golang-dev
https://golang.org/cl/4530079

13 years agoMake unix Readdir and windows Readdirnames return partially successful results on...
Yuval Pavel Zholkover [Wed, 1 Jun 2011 03:12:37 +0000 (13:12 +1000)]
Make unix Readdir and windows Readdirnames return partially successful results on error.
Make plan 9 Readdir & Readdirnames return os.EOF at end.
Also fix typos in the unix and windows comments.

R=golang-dev, fshahriar, bradfitz, rsc, r
CC=golang-dev
https://golang.org/cl/4557053

13 years agofilepath: remove string constants. They are unnecessary.
Rob Pike [Wed, 1 Jun 2011 03:06:04 +0000 (13:06 +1000)]
filepath: remove string constants. They are unnecessary.

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

13 years agogobuilder: include file missing from change, fix build
Andrew Gerrand [Wed, 1 Jun 2011 01:56:46 +0000 (11:56 +1000)]
gobuilder: include file missing from change, fix build

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

13 years agogoinstall: document GOPATH and support relative/absolute installs
Andrew Gerrand [Wed, 1 Jun 2011 00:48:15 +0000 (10:48 +1000)]
goinstall: document GOPATH and support relative/absolute installs
goinstall: more verbose logging with -v

Fixes #1901.

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

13 years agounicode: guarantee that the 32-bit range tables contain only
Rob Pike [Tue, 31 May 2011 23:49:51 +0000 (09:49 +1000)]
unicode: guarantee that the 32-bit range tables contain only
values >= 16 bits, so the lookup code can be smaller in the
common case.
Also make CaseRange uint32s rather than ints, so if we go to
64-bit ints we don't waste more space.

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

13 years agogophertool: make the keyword 'golang'
Rob Pike [Tue, 31 May 2011 21:24:33 +0000 (07:24 +1000)]
gophertool: make the keyword 'golang'

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

13 years agohttp/spdy: fix data race in header decompression.
William Chan [Tue, 31 May 2011 21:05:35 +0000 (14:05 -0700)]
http/spdy: fix data race in header decompression.

flate's reader greedily reads from the shared io.Reader in Framer. This leads to a data race on Framer.r. Fix this by providing a corkedReader to zlib.NewReaderDict(). We uncork the reader and allow it to read the number of bytes in the compressed payload.

Fixes #1884.

R=bradfitz, rsc, go.peter.90
CC=golang-dev
https://golang.org/cl/4530089

13 years agogophertool: also permit typing "go [whatever]" in omnibox
Brad Fitzpatrick [Tue, 31 May 2011 20:16:51 +0000 (13:16 -0700)]
gophertool: also permit typing "go [whatever]" in omnibox

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

13 years agonet: stop Mac popups
Russ Cox [Tue, 31 May 2011 20:15:23 +0000 (16:15 -0400)]
net: stop Mac popups

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

13 years agogc: fix m[x], _ = y.(T)
Russ Cox [Tue, 31 May 2011 19:52:04 +0000 (15:52 -0400)]
gc: fix m[x], _ = y.(T)

Fixes #1900.

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

13 years agogc: disallow ... in type conversions
Anthony Martin [Tue, 31 May 2011 19:41:47 +0000 (15:41 -0400)]
gc: disallow ... in type conversions

Fixes #1866.

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

13 years agoencoding/hex: don't try to print DEL.
Adam Langley [Tue, 31 May 2011 19:40:33 +0000 (15:40 -0400)]
encoding/hex: don't try to print DEL.

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

13 years agogc: implement new shift rules
Russ Cox [Tue, 31 May 2011 19:05:40 +0000 (15:05 -0400)]
gc: implement new shift rules

The change is that 1.0<<2 is now okay.

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

13 years agogc: elide call to runtime.closure for function literals called in-place.
Luuk van Dijk [Tue, 31 May 2011 18:52:21 +0000 (20:52 +0200)]
gc: elide call to runtime.closure for function literals called in-place.

before:
runtime_test.BenchmarkCallClosure        5000000               499 ns/op
runtime_test.BenchmarkCallClosure1       5000000               681 ns/op

after:
runtime_test.BenchmarkCallClosure       500000000                5 ns/op
runtime_test.BenchmarkCallClosure1       10000000              160 ns/op

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

13 years agomisc/cgo: remove reference to 'destroy' function
Russ Cox [Tue, 31 May 2011 18:41:24 +0000 (14:41 -0400)]
misc/cgo: remove reference to 'destroy' function

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

13 years agoundo CL 4515163 / 42c3cfa4d64f
Russ Cox [Tue, 31 May 2011 18:24:21 +0000 (14:24 -0400)]
undo CL 4515163 / 42c3cfa4d64f

breaks Mac build

««« original CL description
runtime: use HOST_CC to compile mkversion

HOST_CC is set in Make.inc, so use that rather
than hardcoding quietgcc

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

»»»

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

13 years agoruntime: use HOST_CC to compile mkversion
Dave Cheney [Tue, 31 May 2011 17:46:11 +0000 (10:46 -0700)]
runtime: use HOST_CC to compile mkversion

HOST_CC is set in Make.inc, so use that rather
than hardcoding quietgcc

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

13 years agogc: check parameter declarations in interface fields
Anthony Martin [Tue, 31 May 2011 17:41:32 +0000 (13:41 -0400)]
gc: check parameter declarations in interface fields

Fixes #1663.
Fixes #1871.

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

13 years agoencoding/hex: add hex dumping.
Adam Langley [Tue, 31 May 2011 16:58:09 +0000 (12:58 -0400)]
encoding/hex: add hex dumping.

I found this useful, esp with an io.MultiWriter. But I fear that
it may be bloat in such a low-level package so please feel free to
decline if you feel likewise.

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

13 years agohttp: have client set Content-Length when possible
Brad Fitzpatrick [Tue, 31 May 2011 15:47:03 +0000 (08:47 -0700)]
http: have client set Content-Length when possible

Also some cleanup, removing redundant code. Make more
things use NewRequest. Add some tests, docs.

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

13 years agonet: name-based destination address selection
Christopher Wedgwood [Tue, 31 May 2011 15:40:11 +0000 (11:40 -0400)]
net: name-based destination address selection

getaddrinfo() orders the addresses according to RFC 3484.

This means when IPv6 is working on a host we get results like:
    []string = {"2001:4810::110", "66.117.47.214"}

and when it's not working we get:
    []string = {"66.117.47.214", "2001:4810::110"}

thus can drop firstFavoriteAddr.

This also means /etc/gai.conf works on relevant systems.

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

13 years agoruntime: reset GOMAXPROCS during tests
Dmitriy Vyukov [Tue, 31 May 2011 14:38:51 +0000 (10:38 -0400)]
runtime: reset GOMAXPROCS during tests

Fix the fact that the test leaves GOMAXPROCS=3
and a running goroutine behind.

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

13 years agosyscall : add ProcAttr field to pass an unescaped command line on windows
Vincent Vanackere [Tue, 31 May 2011 14:21:38 +0000 (10:21 -0400)]
syscall : add ProcAttr field to pass an unescaped command line on windows

On windows, the command line is passed as a single null-terminated string. While the automatic parameter escaping done by syscall.StartProcess works fine with most Windows programs, some applications do their own custom parsing of the command line, in which case the automatic escaping becomes harmful.
This CL adds a new extra CmdLine field to syscall.ProcAttr that will be used as the raw/unescaped command line if not empty.
Fixes #1849.

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

13 years agoruntime: save cdecl registers in Windows SEH handler
Alexey Borzenkov [Tue, 31 May 2011 14:11:47 +0000 (10:11 -0400)]
runtime: save cdecl registers in Windows SEH handler

Fixes #1779

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

13 years agofilepath: Abs must always return a clean path
Gustavo Niemeyer [Tue, 31 May 2011 01:28:59 +0000 (22:28 -0300)]
filepath: Abs must always return a clean path

When I was first coding Abs, I wondered if people wouldn't
expect the path to be consistently clean, even if the path
passed in was already absolute.

CL 4524078 has a potential problem based on exactly that
assumption, so it feels like this behavior is indeed the
most useful and least surprising.

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

13 years agounicode: make the tables smaller.
Rob Pike [Mon, 30 May 2011 23:58:07 +0000 (09:58 +1000)]
unicode: make the tables smaller.
By splitting the ranges into 16-bit values and 32-bit values,
we can reduce about 3000 entries by 48 bits per entry, or about
16KB, at the cost of a little more complexity in the code.

R=iant, bradfitz, rsc, r
CC=golang-dev
https://golang.org/cl/4547066

13 years agogoinstall: skip standard packages
Russ Cox [Mon, 30 May 2011 22:23:16 +0000 (18:23 -0400)]
goinstall: skip standard packages

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

13 years agotemplate: fix and clean interaction between quotes and formatters
Gustavo Niemeyer [Mon, 30 May 2011 14:53:09 +0000 (11:53 -0300)]
template: fix and clean interaction between quotes and formatters

Fixes issue #1897.

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

13 years agogobuilder: remove some windows-specificity
Andrew Gerrand [Mon, 30 May 2011 10:19:56 +0000 (20:19 +1000)]
gobuilder: remove some windows-specificity

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

13 years agopkg: spelling tweaks, I-Z
Robert Hencke [Mon, 30 May 2011 08:02:59 +0000 (18:02 +1000)]
pkg: spelling tweaks, I-Z

also, a few miscellaneous fixes to files outside pkg

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

13 years agogoinstall: use bash to execute gomake
Alex Brainman [Mon, 30 May 2011 06:15:08 +0000 (16:15 +1000)]
goinstall: use bash to execute gomake

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

13 years agosrc: Make.pkg don't create $(TARGDIR) with goinstall.
Yasuhiro Matsumoto [Mon, 30 May 2011 02:35:55 +0000 (12:35 +1000)]
src: Make.pkg don't create $(TARGDIR) with goinstall.

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

13 years agomisc/vim: limit Fmt command to Go buffers.
Yasuhiro Matsumoto [Mon, 30 May 2011 02:20:00 +0000 (12:20 +1000)]
misc/vim: limit Fmt command to Go buffers.

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

13 years agodashboard: send notification emails when the build breaks
Andrew Gerrand [Mon, 30 May 2011 01:27:31 +0000 (11:27 +1000)]
dashboard: send notification emails when the build breaks

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

13 years agogobuilder: fixes for windows
Alex Brainman [Mon, 30 May 2011 01:20:46 +0000 (11:20 +1000)]
gobuilder: fixes for windows

R=r, devon.odell, iant, rsc, adg
CC=bradfitz, golang-dev, jdpoirier
https://golang.org/cl/4536053

13 years agoimage/png: fix encoding of images that don't start at (0, 0).
Nigel Tao [Mon, 30 May 2011 00:55:37 +0000 (10:55 +1000)]
image/png: fix encoding of images that don't start at (0, 0).

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

13 years agogob: fix documentation on Decoder.Decode.
David Symonds [Mon, 30 May 2011 00:48:08 +0000 (10:48 +1000)]
gob: fix documentation on Decoder.Decode.

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

13 years agohttp: let Transport use a custom net.Dial function
Brad Fitzpatrick [Sun, 29 May 2011 16:32:36 +0000 (09:32 -0700)]
http: let Transport use a custom net.Dial function

Permits the use of SOCKS proxy dialer with
the transport.

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

13 years agotemplate: cosmetic cleanups.
Rob Pike [Sun, 29 May 2011 06:13:41 +0000 (16:13 +1000)]
template: cosmetic cleanups.
Remove the idea of space being white.  Sometimes space is green.
Simplify a comment and remove the Latin.

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

13 years agotemplate: fix quote-handling with formatters
Gustavo Niemeyer [Sun, 29 May 2011 03:23:32 +0000 (00:23 -0300)]
template: fix quote-handling with formatters

Fixes issue #1896.

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

13 years agoos: fix os.MkdirAll with backslash path separator.
Yasuhiro Matsumoto [Sun, 29 May 2011 03:03:49 +0000 (13:03 +1000)]
os: fix os.MkdirAll with backslash path separator.
MkdirAll() need to use isSeparator().
Move primary defines of filepath.Separator/filepath.ListSeparator
 to os.PathSeparator/os.PathListSeparator.
Move filepath.isSeparator() to os.IsPathSeparator().
filepath package refer them from os package.
Fixes #1831.

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

13 years agoos: fix windows version of Readdir(0)
Alex Brainman [Sun, 29 May 2011 01:59:35 +0000 (11:59 +1000)]
os: fix windows version of Readdir(0)

Fixes #1893.

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

13 years agogotest, pkg/exec: use bash instead of sh to execute shell scripts on windows
Alex Brainman [Sat, 28 May 2011 11:26:03 +0000 (21:26 +1000)]
gotest, pkg/exec: use bash instead of sh to execute shell scripts on windows

As suggested by dho, iant2.

R=golang-dev, rsc
CC=devon.odell, golang-dev, iant
https://golang.org/cl/4515147

13 years agogo/scanner: don't allow "0x" and "0X" as integers
Evan Shaw [Fri, 27 May 2011 23:47:26 +0000 (16:47 -0700)]
go/scanner: don't allow "0x" and "0X" as integers

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

13 years agohttp: client+server benchmark
Brad Fitzpatrick [Fri, 27 May 2011 23:43:02 +0000 (16:43 -0700)]
http: client+server benchmark

baseline runs: (6g, gopher.mtv)

http_test.BenchmarkClientServer  5000  412588 ns/op
http_test.BenchmarkClientServer  5000  403346 ns/op
http_test.BenchmarkClientServer  5000  413936 ns/op
http_test.BenchmarkClientServer  5000  410287 ns/op
http_test.BenchmarkClientServer  5000  388037 ns/op
http_test.BenchmarkClientServer  5000  405545 ns/op
http_test.BenchmarkClientServer  5000  405179 ns/op
http_test.BenchmarkClientServer  5000  413827 ns/op
http_test.BenchmarkClientServer  5000  392723 ns/op

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

13 years agoencoding/binary: add a non-reflect fast path for Write
Brad Fitzpatrick [Fri, 27 May 2011 23:29:33 +0000 (16:29 -0700)]
encoding/binary: add a non-reflect fast path for Write

before/after:
binary.BenchmarkWrite   100000      18312 ns/op
binary.BenchmarkWrite   500000       4468 ns/op

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

13 years agobig: make Int and Rat implement fmt.Scanner
Evan Shaw [Fri, 27 May 2011 22:51:00 +0000 (15:51 -0700)]
big: make Int and Rat implement fmt.Scanner

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

13 years agotime: midnight is 12AM.
Rob Pike [Fri, 27 May 2011 21:06:53 +0000 (07:06 +1000)]
time: midnight is 12AM.
This is the other half of the problem fixed at noon by the previous change.

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

13 years agoos: yet more Readdir tests and fix earlier regression
Brad Fitzpatrick [Fri, 27 May 2011 19:58:59 +0000 (12:58 -0700)]
os: yet more Readdir tests and fix earlier regression

R=golang-dev, fshahriar
CC=golang-dev
https://golang.org/cl/4548068

13 years agoos: improve Readdir test coverage, fix Readdir(0) on EOF
Brad Fitzpatrick [Fri, 27 May 2011 19:14:48 +0000 (12:14 -0700)]
os: improve Readdir test coverage, fix Readdir(0) on EOF

Adds tests for Readdir and Readdirnames with different n
values.  No good way to inject faults during full reads,
though.

Also fixes bug report from fshahriar:
Readdir(0) wasn't behaving like Readdir(-1).

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

13 years agohttp: propagate Set-Cookie in reverse proxy
Brad Fitzpatrick [Fri, 27 May 2011 18:06:53 +0000 (11:06 -0700)]
http: propagate Set-Cookie in reverse proxy

Also adds Host header tests.

Fixes #1886

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

13 years agohttp/spdy: temporarily disable some failing tests
Brad Fitzpatrick [Fri, 27 May 2011 17:08:31 +0000 (10:08 -0700)]
http/spdy: temporarily disable some failing tests

Issue 1886 has details

R=golang-dev, willchan
CC=golang-dev
https://golang.org/cl/4527083

13 years agotime: fix Format bug: noon is 12PM, not 0PM.
Rob Pike [Fri, 27 May 2011 13:24:39 +0000 (23:24 +1000)]
time: fix Format bug: noon is 12PM, not 0PM.
Fixes #1882.

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

13 years agocgo: restrict #cgo directives to prevent shell expansion
Gustavo Niemeyer [Fri, 27 May 2011 11:46:51 +0000 (08:46 -0300)]
cgo: restrict #cgo directives to prevent shell expansion

Fixes issue #1879.

Directives were not directly expanded, but since their
content ended up in makefiles, further expansion would
take place there.  This prevents such artifacts by
restricting the set of characters that may be used in
a directive value.

To build the list of safe characters I went through the
contents of /usr/lib/pkgconfig and extracted LDFLAGS
and CFLAGS information, so hopefully this is a
reasonable default to get started.

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

13 years agocrypto/tls/generate_cert.go: fix misspelling of O_CREATE.
Rob Pike [Fri, 27 May 2011 11:06:50 +0000 (21:06 +1000)]
crypto/tls/generate_cert.go: fix misspelling of O_CREATE.
Fixes #1888.

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

13 years agoos: another attempt to handle OpenFile flag parameter properly on Windows
Alex Brainman [Fri, 27 May 2011 07:02:24 +0000 (17:02 +1000)]
os: another attempt to handle OpenFile flag parameter properly on Windows

Fixes #1791.

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

13 years agodoc: put Release History link on 'Documentation' page
Andrew Gerrand [Fri, 27 May 2011 06:07:30 +0000 (16:07 +1000)]
doc: put Release History link on 'Documentation' page
Also put Weekly Snapshot History link on 'Contributing' page

Fixes #1885.

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

13 years agoruntime: fix mmap error return on linux.
Dmitry Chestnykh [Fri, 27 May 2011 04:43:27 +0000 (21:43 -0700)]
runtime: fix mmap error return on linux.

Fixes #1511 again.

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

13 years agocgo: support pkg-config for flags and libs
Gustavo Niemeyer [Fri, 27 May 2011 01:19:23 +0000 (22:19 -0300)]
cgo: support pkg-config for flags and libs

Fixes issue #1853.

R=golang-dev, mattn.jp, adg
CC=golang-dev
https://golang.org/cl/4550084

13 years agosyscall: add routing messages support for BSD variants
Mikio Hara [Fri, 27 May 2011 00:02:03 +0000 (20:02 -0400)]
syscall: add routing messages support for BSD variants

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

13 years agoos: TestMkdirAll should not fail to delete _test/_TestMkdirAll_ on Windows
Alex Brainman [Thu, 26 May 2011 23:52:15 +0000 (09:52 +1000)]
os: TestMkdirAll should not fail to delete _test/_TestMkdirAll_ on Windows

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

13 years agosyscall: add routing messages support for Linux
Mikio Hara [Thu, 26 May 2011 21:04:58 +0000 (17:04 -0400)]
syscall: add routing messages support for Linux

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

13 years agocompress/flate: fix Huffman tree bug
Ivan Krasin [Thu, 26 May 2011 21:02:11 +0000 (17:02 -0400)]
compress/flate: fix Huffman tree bug
Incorporate refactoring and a regression test from https://golang.org/cl/4538090/

R=rsc, go.peter.90, imkrasin
CC=golang-dev, mirtchovski
https://golang.org/cl/4524070

13 years agofix build: temporarily disable the use of strings.Reader UnreadRune in fmt
Robert Griesemer [Thu, 26 May 2011 18:54:10 +0000 (11:54 -0700)]
fix build: temporarily disable the use of strings.Reader UnreadRune in fmt

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

13 years agogc: patch y.tab.c to fix build when using Bison 2.5
Ian Lance Taylor [Thu, 26 May 2011 18:28:23 +0000 (11:28 -0700)]
gc: patch y.tab.c to fix build when using Bison 2.5

Fixes #1843.

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

13 years agoio: add ByteScanner, RuneScanner interfaces
Robert Griesemer [Thu, 26 May 2011 18:03:52 +0000 (11:03 -0700)]
io: add ByteScanner, RuneScanner interfaces

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