]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agoruntime: release unused memory to the OS.
Sébastien Paolacci [Thu, 16 Feb 2012 18:30:04 +0000 (13:30 -0500)]
runtime: release unused memory to the OS.

Periodically browse MHeap's freelists for long unused spans and release them if any.

Current hardcoded settings:
        - GC is forced if none occured over the last 2 minutes.
        - spans are handed back after 5 minutes of uselessness.

SysUnused (for Unix) is a wrapper on madvise MADV_DONTNEED on Linux and MADV_FREE on BSDs.

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

13 years agocmd, pkg/go/*: fix "go vet" warnings for go/ast and go/printer
Nigel Tao [Thu, 16 Feb 2012 11:43:41 +0000 (22:43 +1100)]
cmd, pkg/go/*: fix "go vet" warnings for go/ast and go/printer
struct literals.

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

13 years agoos: fix build
Rob Pike [Thu, 16 Feb 2012 06:39:04 +0000 (17:39 +1100)]
os: fix build

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5674070

13 years agohtml/template: clone is implemented elsewhere, so delete this implementation
Rob Pike [Thu, 16 Feb 2012 06:36:06 +0000 (17:36 +1100)]
html/template: clone is implemented elsewhere, so delete this implementation

R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/5676064

13 years agoall: errors caught by go vet
Rob Pike [Thu, 16 Feb 2012 06:21:21 +0000 (17:21 +1100)]
all: errors caught by go vet

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

13 years agodashboard: tidy up 'top' link.
David Symonds [Thu, 16 Feb 2012 06:14:26 +0000 (17:14 +1100)]
dashboard: tidy up 'top' link.

The previous link worked, but was unnecessary and had a trailing "}".

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

13 years agoos: remove use of _test
Rob Pike [Thu, 16 Feb 2012 06:05:43 +0000 (17:05 +1100)]
os: remove use of _test
Part of issue 2573.

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

13 years agoexp/inotify: remove use of _test
Rob Pike [Thu, 16 Feb 2012 05:23:58 +0000 (21:23 -0800)]
exp/inotify: remove use of _test
Fixes #2573.

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

13 years agowindows: fix build
Rob Pike [Thu, 16 Feb 2012 05:07:26 +0000 (16:07 +1100)]
windows: fix build

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

13 years agonet/url: Rename ParseWithReference to ParseWithFragment.
David Symonds [Thu, 16 Feb 2012 04:56:03 +0000 (15:56 +1100)]
net/url: Rename ParseWithReference to ParseWithFragment.

Updates #2946.

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

13 years agoexp/winfsnotify: remove reference to _test
Rob Pike [Thu, 16 Feb 2012 04:34:27 +0000 (15:34 +1100)]
exp/winfsnotify: remove reference to _test
Updates #2573.

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

13 years agonet/url: regularise receiver names.
David Symonds [Thu, 16 Feb 2012 04:07:54 +0000 (15:07 +1100)]
net/url: regularise receiver names.

Update #2946.

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

13 years agodebug/gosym: more carefully build the test binary.
David Symonds [Thu, 16 Feb 2012 04:06:12 +0000 (15:06 +1100)]
debug/gosym: more carefully build the test binary.

TBR=r
CC=golang-dev
https://golang.org/cl/5676062

13 years agoencoding/xml: add MarshalIndent and move the example
Gustavo Niemeyer [Thu, 16 Feb 2012 04:01:46 +0000 (02:01 -0200)]
encoding/xml: add MarshalIndent and move the example

An unindented XML example is hard to follow. MarshalIndent
allows moving the example over to a test file (and fixing it).

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

13 years agodebug/gosym: dump 6a/6l output to process stdout/stderr so we can see failures.
David Symonds [Thu, 16 Feb 2012 03:54:45 +0000 (14:54 +1100)]
debug/gosym: dump 6a/6l output to process stdout/stderr so we can see failures.

TBR=r
CC=golang-dev
https://golang.org/cl/5671060

13 years agodebug/gosym: Remove Makefile, rewrite test using go tool.
David Symonds [Thu, 16 Feb 2012 03:47:14 +0000 (14:47 +1100)]
debug/gosym: Remove Makefile, rewrite test using go tool.

Update #2573.

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

13 years agosort: add interface examples
Andrew Gerrand [Thu, 16 Feb 2012 02:16:07 +0000 (13:16 +1100)]
sort: add interface examples

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

13 years agocmd/go: fix 'go help'
Rob Pike [Thu, 16 Feb 2012 02:12:42 +0000 (18:12 -0800)]
cmd/go: fix 'go help'
It depended on old behavior of functions in structs.
Solved by adding a boolean method to check .Run != nil.

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

13 years agogo/ast: return Examples in name order
Andrew Gerrand [Thu, 16 Feb 2012 02:08:35 +0000 (13:08 +1100)]
go/ast: return Examples in name order

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

13 years agogodoc: show example function doc comments in UI
Andrew Gerrand [Thu, 16 Feb 2012 01:43:22 +0000 (12:43 +1100)]
godoc: show example function doc comments in UI

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

13 years agogodoc: make example code more readable with new comment convention
Andrew Gerrand [Thu, 16 Feb 2012 00:50:28 +0000 (11:50 +1100)]
godoc: make example code more readable with new comment convention
go/doc: move Examples to go/ast
cmd/go: use go/doc to read examples
src/pkg: update examples to use new convention

This is to make whole file examples more readable. When presented as a
complete function, preceding an Example with its output is confusing.
The new convention is to put the expected output in the final comment
of the example, preceded by the string "output:" (case insensitive).

An idiomatic example looks like this:

// This example demonstrates Foo by doing bar and quux.
func ExampleFoo() {
        // example body that does bar and quux

        // Output:
        // example output
}

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

13 years agomake.bat: implement --no-clean
Alex Brainman [Thu, 16 Feb 2012 00:34:41 +0000 (11:34 +1100)]
make.bat: implement --no-clean

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

13 years agobuild: use setlocal in run.bat
Alex Brainman [Wed, 15 Feb 2012 23:44:55 +0000 (10:44 +1100)]
build: use setlocal in run.bat

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

13 years agobuild: keep environment variable changes local during Windows build
Alex Brainman [Wed, 15 Feb 2012 23:26:01 +0000 (10:26 +1100)]
build: keep environment variable changes local during Windows build

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

13 years agocmd/gc: error on constant shift overflows.
Rémy Oudompheng [Wed, 15 Feb 2012 23:19:42 +0000 (00:19 +0100)]
cmd/gc: error on constant shift overflows.

Fixes #3019.

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

13 years agobufio: don't return errors from good Peeks
Brad Fitzpatrick [Wed, 15 Feb 2012 23:15:36 +0000 (10:15 +1100)]
bufio: don't return errors from good Peeks

Fixes #3022

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

13 years agonet/http: add some examples
Brad Fitzpatrick [Wed, 15 Feb 2012 23:15:10 +0000 (10:15 +1100)]
net/http: add some examples

R=golang-dev, dsymonds, adg, rogpeppe, bradfitz
CC=golang-dev
https://golang.org/cl/5673052

13 years agogodoc: support for package examples, display example suffixes
Andrew Gerrand [Wed, 15 Feb 2012 22:44:01 +0000 (09:44 +1100)]
godoc: support for package examples, display example suffixes

Fixes #2896.

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

13 years agonet/http: fix race in sendfile test
Brad Fitzpatrick [Wed, 15 Feb 2012 22:27:26 +0000 (09:27 +1100)]
net/http: fix race in sendfile test

Whoops. Consume the body of the first request
before making the subsequent /quit request.

R=golang-dev, untheoretic
CC=golang-dev
https://golang.org/cl/5674054

13 years agogo/printer: don't lose relevant parentheses when rewriting selector expressions
Robert Griesemer [Wed, 15 Feb 2012 20:25:37 +0000 (12:25 -0800)]
go/printer: don't lose relevant parentheses when rewriting selector expressions

Also: Simplified handling of selector expressions. As a result, complicated
multi-line expressions containing selectors and calls/indices with arguments
broken accross lines don't get indented the same way as before, but the change
is minimal (see tests) and there's no such code in the std library. It seems
a worthwhile compromise given the much simpler code.

Applied gofmt -w $GOROOT/src $GOROOT/misc .

Fixes #1847.

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

13 years agoruntime: define NSIG to fix plan 9 build
David du Colombier [Wed, 15 Feb 2012 19:36:20 +0000 (14:36 -0500)]
runtime: define NSIG to fix plan 9 build

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

13 years agoA+C: David du Colombier (individual CLA)
Russ Cox [Wed, 15 Feb 2012 19:36:12 +0000 (14:36 -0500)]
A+C: David du Colombier (individual CLA)

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

13 years agocmd/go: suggest 'go test -i [args to test]'
Shenghou Ma [Wed, 15 Feb 2012 18:26:50 +0000 (13:26 -0500)]
cmd/go: suggest 'go test -i [args to test]'
        Fixes #3023.

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

13 years agocmd/go: go test -i correctly handle cgo packages
Shenghou Ma [Wed, 15 Feb 2012 18:26:22 +0000 (13:26 -0500)]
cmd/go: go test -i correctly handle cgo packages
Previous CL (5674043) omit the case where runtime/cgo itself is out-of-date.
Fixes #2936 (again).

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

13 years agobuild: add make.bash --no-clean option
Russ Cox [Wed, 15 Feb 2012 16:48:17 +0000 (11:48 -0500)]
build: add make.bash --no-clean option

Makes it possible to run

GOARCH=amd64 make.bash
GOARCH=386 make.bash --no-clean

to avoid deleting some of the work done by the first one.

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

13 years agotest: add new test of indirect type references
Ian Lance Taylor [Wed, 15 Feb 2012 15:39:46 +0000 (07:39 -0800)]
test: add new test of indirect type references

Similar to bug190, but without recursive reference.  Crashed
gccgo.

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

13 years agobuild: fix clean.bash
Mikio Hara [Wed, 15 Feb 2012 14:52:07 +0000 (23:52 +0900)]
build: fix clean.bash

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

13 years agocmd/dist: use correct package target when cross-compiling
Alex Brainman [Wed, 15 Feb 2012 14:02:45 +0000 (09:02 -0500)]
cmd/dist: use correct package target when cross-compiling

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

13 years ago5c, 6c, 8c, 6g, 8g: correct boundary checking
Shenghou Ma [Wed, 15 Feb 2012 13:59:03 +0000 (08:59 -0500)]
5c, 6c, 8c, 6g, 8g: correct boundary checking
    CL 5666043 fixed the same checking for 5g.

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

13 years agodoc: fix links
Brad Fitzpatrick [Wed, 15 Feb 2012 08:59:01 +0000 (00:59 -0800)]
doc: fix links

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

13 years agosyscall: Make Pdeathsig type Signal in SysProcAttr on Linux.
Albert Strasheim [Wed, 15 Feb 2012 05:31:20 +0000 (21:31 -0800)]
syscall: Make Pdeathsig type Signal in SysProcAttr on Linux.

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

13 years agohtml/template: add Clone and AddParseTree. Make text/template's Clone
Nigel Tao [Wed, 15 Feb 2012 05:16:30 +0000 (16:16 +1100)]
html/template: add Clone and AddParseTree. Make text/template's Clone
return (*Template, error), not just *Template.

Fixes #2757.

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

13 years agotext/template: evaluate function fields
Rob Pike [Wed, 15 Feb 2012 05:05:34 +0000 (16:05 +1100)]
text/template: evaluate function fields
Just an oversight they didn't work and easy to address.

Fixes #3025.

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

13 years agotime: run TestTicker for longer during short test, otherwise it fails
Alex Brainman [Wed, 15 Feb 2012 03:56:47 +0000 (14:56 +1100)]
time: run TestTicker for longer during short test, otherwise it fails

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

13 years agotag weekly.2012-02-14
Andrew Gerrand [Wed, 15 Feb 2012 03:45:54 +0000 (14:45 +1100)]
tag weekly.2012-02-14

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

13 years agofix: add fix for bufio, gzip, zlib NewWriterXxx changes. weekly.2012-02-14
Nigel Tao [Wed, 15 Feb 2012 03:41:47 +0000 (14:41 +1100)]
fix: add fix for bufio, gzip, zlib NewWriterXxx changes.

Fixes #2979.

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

13 years agocmd/dist: xprintf() can't output whole of 'dist env'.
Yasuhiro Matsumoto [Wed, 15 Feb 2012 03:25:27 +0000 (14:25 +1100)]
cmd/dist: xprintf() can't output whole of 'dist env'.

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

13 years agoos/exec: add some examples
Brad Fitzpatrick [Wed, 15 Feb 2012 03:24:24 +0000 (14:24 +1100)]
os/exec: add some examples

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

13 years agodoc: fix snapshot notes
Andrew Gerrand [Wed, 15 Feb 2012 03:20:21 +0000 (14:20 +1100)]
doc: fix snapshot notes

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

13 years agoweekly.2012-02-14
Andrew Gerrand [Wed, 15 Feb 2012 03:15:33 +0000 (14:15 +1100)]
weekly.2012-02-14

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

13 years agoreflect: fix panic strings
Lai Jiangshan [Wed, 15 Feb 2012 02:51:49 +0000 (13:51 +1100)]
reflect: fix panic strings

use ':' instead of ';' to keep consistency with the other panic strings

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

13 years agostrings: add Bernardo O'Higgins example
Andrew Gerrand [Wed, 15 Feb 2012 02:38:28 +0000 (13:38 +1100)]
strings: add Bernardo O'Higgins example

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

13 years agodoc: fix codewalk/markov.go
Lai Jiangshan [Wed, 15 Feb 2012 02:07:34 +0000 (13:07 +1100)]
doc: fix codewalk/markov.go

When I build it, I got:
/home/njubee/work/golang/doc/codewalk/markov.go:124: undefined: time.Nanoseconds
time.Nanoseconds() does not exist now, use time.Now().UnixNano() instead

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

13 years agoA+C: Lai Jiangshan
Andrew Gerrand [Wed, 15 Feb 2012 02:07:12 +0000 (13:07 +1100)]
A+C: Lai Jiangshan

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

13 years agodoc: add playground.js
Andrew Gerrand [Wed, 15 Feb 2012 01:59:50 +0000 (12:59 +1100)]
doc: add playground.js

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

13 years agodoc: add App Engine docs to 'learn' and 'reference' pages
Andrew Gerrand [Wed, 15 Feb 2012 01:58:40 +0000 (12:58 +1100)]
doc: add App Engine docs to 'learn' and 'reference' pages

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

13 years agobytes,strings: make *Reader implement io.ReaderAt
Brad Fitzpatrick [Wed, 15 Feb 2012 01:58:00 +0000 (12:58 +1100)]
bytes,strings: make *Reader implement io.ReaderAt

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

13 years agolib/godoc: fix subdirectories html reference
Gustavo Niemeyer [Wed, 15 Feb 2012 00:18:29 +0000 (22:18 -0200)]
lib/godoc: fix subdirectories html reference

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

13 years agoruntime: fix grsec support
Gustavo Niemeyer [Wed, 15 Feb 2012 00:09:02 +0000 (22:09 -0200)]
runtime: fix grsec support

Changeset 36c9c7810f14 broke support for grsec-patched kernels.
Those do not give back the address requested without MAP_FIXED,
so when verifying an mmap without this flag for success, the
resulting address must not be compared against the requested
address since it may have succeeded at a different location.

R=golang-dev, rsc, gustavo, iant
CC=golang-dev
https://golang.org/cl/5650072

13 years agobytes: add Reader
Brad Fitzpatrick [Wed, 15 Feb 2012 00:06:16 +0000 (11:06 +1100)]
bytes: add Reader

copy of strings/reader{,_test}.go with
a few s/string/[]byte/

Fixes #2861

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

13 years agonet/http: make strace test more robust
Brad Fitzpatrick [Wed, 15 Feb 2012 00:05:51 +0000 (11:05 +1100)]
net/http: make strace test more robust

Apparently some distros don't let you ptrace attach
to your own existing processes.

Run strace on the child directly, instead, which
reportedly is more often allowed, and makes the
code simpler too.

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

13 years agodoc: grey out line numbers
Andrew Gerrand [Tue, 14 Feb 2012 23:31:28 +0000 (10:31 +1100)]
doc: grey out line numbers

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

13 years agobuild: create the correct $GOTOOLDIR.
David Symonds [Tue, 14 Feb 2012 22:06:24 +0000 (09:06 +1100)]
build: create the correct $GOTOOLDIR.

Before this, make.bash --dist-tool would fail,
because $GOROOT/bin/tool was being mkdir'd
instead of $GOROOT/pkg/tool/linux_amd64.

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

13 years agogodoc: make godoc go work
Robert Griesemer [Tue, 14 Feb 2012 21:57:21 +0000 (13:57 -0800)]
godoc: make godoc go work

- if a package path leads to subdirectories only,
  show command instead, if any
- to force documentation for a command, use the
  cmd/ prefix, as in: godoc cmd/go
  (note that for the go command, the prefix is
  not required since there is no actual go library
  package at the moment)

Fixes #3012.

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

13 years agobuild: fix sudo.bash.
David Symonds [Tue, 14 Feb 2012 21:42:16 +0000 (08:42 +1100)]
build: fix sudo.bash.

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

13 years agocmd/go: a raft of fixes
Russ Cox [Tue, 14 Feb 2012 21:39:20 +0000 (16:39 -0500)]
cmd/go: a raft of fixes

* add -work option to save temporary files (Fixes issue 2980)
* fix go test -i to work with cgo packages (Fixes issue 2936)
* do not overwrite/remove empty directories or non-object
  files during build (Fixes issue 2829)
* remove package main vs package non-main heuristic:
  a directory must contain only one package (Fixes issue 2864)
* to make last item workable, ignore +build tags for files
  named on command line: go build x.go builds x.go even
  if it says // +build ignore.
* add // +build ignore tags to helper programs

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

13 years agogc: fix comment in mkbuiltin
Maxim Pimenov [Tue, 14 Feb 2012 21:27:35 +0000 (16:27 -0500)]
gc: fix comment in mkbuiltin

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

13 years agoruntime, time: accelerate tests in short mode.
Rémy Oudompheng [Tue, 14 Feb 2012 21:13:19 +0000 (22:13 +0100)]
runtime, time: accelerate tests in short mode.

                                   before   after
go test -short time                4.144s  1.215s
go test -short runtime             1.315s  0.351s
go test -short -cpu=1,2,4 runtime  4.376s  1.266s

Partially solves issue 3015.

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

13 years agocgo: add support for returning errno with gccgo.
Rémy Oudompheng [Tue, 14 Feb 2012 19:23:45 +0000 (20:23 +0100)]
cgo: add support for returning errno with gccgo.

Also eliminate some warnings in builds.

R=golang-dev, fullung, iant, rsc
CC=golang-dev, remy
https://golang.org/cl/5650066

13 years agoos: rename SyscallError.Errno to SyscallError.Err
Anthony Martin [Tue, 14 Feb 2012 19:22:34 +0000 (14:22 -0500)]
os: rename SyscallError.Errno to SyscallError.Err

This lets us get rid of the OS-dependent implementations
of SyscallError.  The name "Err" was chosen to match the
PathError type.

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

13 years agosyscall: linux Tgkill takes a Signal too
Russ Cox [Tue, 14 Feb 2012 18:07:14 +0000 (13:07 -0500)]
syscall: linux Tgkill takes a Signal too

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

13 years agogo/doc: treat predeclared error interface like an exported type
Robert Griesemer [Tue, 14 Feb 2012 17:13:12 +0000 (09:13 -0800)]
go/doc: treat predeclared error interface like an exported type

Also added -files flag to provide regexp for test files for
selective testing.

Fixes #2956.

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

13 years agonet: prefer an IPv4 listen if no address given
Mikio Hara [Tue, 14 Feb 2012 16:59:18 +0000 (01:59 +0900)]
net: prefer an IPv4 listen if no address given

This CL avoids net.Listen("tcp", ":80"), http.ListenAdnServe(":80")
prefer an IPv6 listen.

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

13 years agocmd/vet: give warning for construct 'Println(os.Stderr, ...)'
Shenghou Ma [Tue, 14 Feb 2012 16:24:41 +0000 (11:24 -0500)]
cmd/vet: give warning for construct 'Println(os.Stderr, ...)'
        also fixes this bug in net/http/httptest.

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

13 years agotime: use "2006-01-02 15:04:05.999999999 -0700 MST" as String format
Russ Cox [Tue, 14 Feb 2012 16:17:48 +0000 (11:17 -0500)]
time: use "2006-01-02 15:04:05.999999999 -0700 MST" as String format

This change shows all the information present
in the Time value (now including fractional seconds)
and also arranges the fields so that, within a single time zone,
string comparison and time comparison agree.

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

13 years agogo1.tmpl: fix merge
Adam Langley [Tue, 14 Feb 2012 12:13:57 +0000 (07:13 -0500)]
go1.tmpl: fix merge

hg massively messed up a simple merge for 9d7addec2635 in what I can
only imagine was a public service announcement that everyone should
use git.

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

13 years agobuilder: fix windows environment
Russ Cox [Tue, 14 Feb 2012 06:23:25 +0000 (01:23 -0500)]
builder: fix windows environment

Not causing problems yet, but no need to
keep using cygwin paths now that we're off cygwin.

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

13 years agoruntime: on 386, fix FP control word on all threads, not just initial thread
Russ Cox [Tue, 14 Feb 2012 06:23:15 +0000 (01:23 -0500)]
runtime: on 386, fix FP control word on all threads, not just initial thread

It is possible that Linux and Windows copy the FP control word
from the parent thread when creating a new thread.  Empirically,
Darwin does not.  Reset the FP control world in all cases.

Enable the floating-point strconv test.

Fixes #2917 (again).

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

13 years agogo/doc, godoc: regard lone examples as "whole file" examples
Andrew Gerrand [Tue, 14 Feb 2012 06:19:59 +0000 (17:19 +1100)]
go/doc, godoc: regard lone examples as "whole file" examples

Fixes #2930.

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

13 years ago5g: fix memory corruption
Russ Cox [Tue, 14 Feb 2012 06:13:14 +0000 (01:13 -0500)]
5g: fix memory corruption

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

13 years agonet/http: more robust test
Brad Fitzpatrick [Tue, 14 Feb 2012 06:11:12 +0000 (17:11 +1100)]
net/http: more robust test

Fixes #3014

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

13 years agodoc: update install.html for binary distros, add install-source.html
Andrew Gerrand [Tue, 14 Feb 2012 06:02:28 +0000 (17:02 +1100)]
doc: update install.html for binary distros, add install-source.html

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

13 years agonet: fix windows build
Mikio Hara [Tue, 14 Feb 2012 05:57:57 +0000 (14:57 +0900)]
net: fix windows build

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

13 years agosyscall: regenerate z-files for openbsd
Mikio Hara [Tue, 14 Feb 2012 05:44:59 +0000 (14:44 +0900)]
syscall: regenerate z-files for openbsd

This CL provides regenerated z-files for OpenBSD 5.0 stable.
Also fixes OpenBSD build.

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

13 years agonet: avoid Shutdown during Close
Russ Cox [Tue, 14 Feb 2012 05:40:37 +0000 (00:40 -0500)]
net: avoid Shutdown during Close

Once we've evicted all the blocked I/O, the ref count
should go to zero quickly, so it should be safe to
postpone the close(2) until then.

Fixes #1898.
Fixes #2116.
Fixes #2122.

R=golang-dev, mikioh.mikioh, bradfitz, fullung, iant
CC=golang-dev
https://golang.org/cl/5649076

13 years agonet: disable multicast test on Alpha GNU/Linux
Ian Lance Taylor [Tue, 14 Feb 2012 05:31:21 +0000 (21:31 -0800)]
net: disable multicast test on Alpha GNU/Linux

Alpha GNU/Linux does not have /proc/net/igmp[6].

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

13 years agocmd/dist: exclude cov and prof from releases
Russ Cox [Tue, 14 Feb 2012 05:18:30 +0000 (00:18 -0500)]
cmd/dist: exclude cov and prof from releases
Also check for old and exp.

Fixes #2764.
Fixes #2765.

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

13 years agocmd/go: go get scheme detection
Daniel Krech [Tue, 14 Feb 2012 04:46:31 +0000 (23:46 -0500)]
cmd/go: go get scheme detection

Fixes #2895.

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

13 years agoA+C: Daniel Krech (individual CLA)
Russ Cox [Tue, 14 Feb 2012 04:45:49 +0000 (23:45 -0500)]
A+C: Daniel Krech (individual CLA)

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

13 years agonet: disable TestDialTimeout on Windows
Russ Cox [Tue, 14 Feb 2012 04:30:40 +0000 (23:30 -0500)]
net: disable TestDialTimeout on Windows

Filed issue 3016 to fix this, but I really want
to see a "ok" in the Windows column so we
know what is and is not working.

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

13 years agonet/http: re-enable test
Brad Fitzpatrick [Tue, 14 Feb 2012 04:26:09 +0000 (15:26 +1100)]
net/http: re-enable test

Now with a bit more paranoia and lower number of requests
to keep it under the default OS X 256 fd limit.

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

13 years agoruntime: use startpanic so that only one thread handles an incoming SIGQUIT
Russ Cox [Tue, 14 Feb 2012 04:06:21 +0000 (23:06 -0500)]
runtime: use startpanic so that only one thread handles an incoming SIGQUIT

Typing ^\ delivers the SIGQUIT to all threads, it appears.

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

13 years agoruntime/debug: fix build
Russ Cox [Tue, 14 Feb 2012 04:05:19 +0000 (23:05 -0500)]
runtime/debug: fix build

TBR=r
CC=golang-dev
https://golang.org/cl/5661053

13 years agonet/http: don't spin on temporary accept failure
Brad Fitzpatrick [Tue, 14 Feb 2012 04:04:29 +0000 (15:04 +1100)]
net/http: don't spin on temporary accept failure

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

13 years agobuild: fix windows build
Russ Cox [Tue, 14 Feb 2012 03:56:42 +0000 (22:56 -0500)]
build: fix windows build

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5656051

13 years agotesting: let runtime catch the panic.
Rob Pike [Tue, 14 Feb 2012 03:53:30 +0000 (14:53 +1100)]
testing: let runtime catch the panic.
It's not as pretty, but it deletes some irrelevant information from the
printout and avoids a dependency.
It also means the test binary will stop if a test panics. That's a feature,
not a bug.
Any output printed by the test appears before the panic traceback.

before:

--- FAIL: TestPanic (0.00 seconds)
        fmt_test.go:19: HI
        testing.go:257: runtime error: index out of range
                /Users/r/go/src/pkg/testing/testing.go:257 (0x23998)
                        _func_003: t.Logf("%s\n%s", err, debug.Stack())
                /Users/r/go/src/pkg/runtime/proc.c:1388 (0x10d2d)
                        panic: reflect·call(d->fn, d->args, d->siz);
                /Users/r/go/src/pkg/runtime/runtime.c:128 (0x119b0)
                        panicstring: runtime·panic(err);
                /Users/r/go/src/pkg/runtime/runtime.c:85 (0x11857)
                        panicindex: runtime·panicstring("index out of range");
                /Users/r/go/src/pkg/fmt/fmt_test.go:21 (0x23d72)
                        TestPanic: a[10]=1
                /Users/r/go/src/pkg/testing/testing.go:264 (0x21b75)
                        tRunner: test.F(t)
                /Users/r/go/src/pkg/runtime/proc.c:258 (0xee9e)
                        goexit: runtime·goexit(void)
FAIL

after:

--- FAIL: TestPanic (0.00 seconds)
        fmt_test.go:19: HI
panic: runtime error: index out of range [recovered]
        panic: (*testing.T) (0xec3b0,0xf8400001c0)

goroutine 2 [running]:
testing._func_003(0x21f5fa8, 0x21f5100, 0x21f5fb8, 0x21f5e88)
        /Users/r/go/src/pkg/testing/testing.go:259 +0x108
----- stack segment boundary -----
fmt_test.TestPanic(0xf8400001c0, 0x27603728)
        /Users/r/go/src/pkg/fmt/fmt_test.go:21 +0x6b
testing.tRunner(0xf8400001c0, 0x18edb8, 0x0, 0x0)
        /Users/r/go/src/pkg/testing/testing.go:264 +0x6f
created by testing.RunTests
        /Users/r/go/src/pkg/testing/testing.go:343 +0x76e

goroutine 1 [chan receive]:
testing.RunTests(0x2000, 0x18edb8, 0x2400000024, 0x100000001, 0x200000001, ...)
        /Users/r/go/src/pkg/testing/testing.go:344 +0x791
testing.Main(0x2000, 0x18edb8, 0x2400000024, 0x188a58, 0x800000008, ...)
        /Users/r/go/src/pkg/testing/testing.go:275 +0x62
main.main()
        /var/folders/++/+++Fn+++6+0++4RjPqRgNE++2Qk/-Tmp-/go-build743922747/fmt/_test/_testmain.go:129 +0x91
exit status 2

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

13 years agogodoc: list examples in index
Andrew Gerrand [Tue, 14 Feb 2012 03:52:00 +0000 (14:52 +1100)]
godoc: list examples in index

Fixes #2897.

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

13 years agogo/parser: better error messages for missing commas
Robert Griesemer [Tue, 14 Feb 2012 03:48:27 +0000 (19:48 -0800)]
go/parser: better error messages for missing commas

Fixes #3008.

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

13 years agobuild: set $PATH during make.bash
Russ Cox [Tue, 14 Feb 2012 03:46:50 +0000 (22:46 -0500)]
build: set $PATH during make.bash

Should fix build breakage.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5656050

13 years agocmd/dist: cross-compiling fixes
Russ Cox [Tue, 14 Feb 2012 03:31:51 +0000 (22:31 -0500)]
cmd/dist: cross-compiling fixes

This CL makes it possible to run make.bash with
GOOS and GOARCH set to something other than
the native host GOOS and GOARCH.

As part of the CL, the tool directory moves from bin/tool/
to pkg/tool/goos_goarch where goos and goarch are
the values for the host system (running the build), not
the target.  pkg/ is not technically appropriate, but C objects
are there now tool (pkg/obj/) so this puts all the generated
binaries in one place (rm -rf $GOROOT/pkg cleans everything).
Including goos_goarch in the name allows different systems
to share a single $GOROOT on a shared file system.

Fixes #2920.

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