]> Cypherpunks repositories - gostls13.git/log
gostls13.git
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

13 years agonet/http: disable buggy test
Russ Cox [Tue, 14 Feb 2012 03:23:04 +0000 (22:23 -0500)]
net/http: disable buggy test

Generates an infinite stream (at least >1GB) of:

=== RUN TestTransportPersistConnLeak
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files
2012/02/13 22:20:19 http: Accept error: accept tcp 127.0.0.1:63972:
too many open files

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

13 years agoruntime, syscall, os/signal: fix windows build
Alex Brainman [Tue, 14 Feb 2012 02:51:38 +0000 (13:51 +1100)]
runtime, syscall, os/signal: fix windows build

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

13 years agosyscall: update BSD variants to sync with new os/signal
Mikio Hara [Tue, 14 Feb 2012 02:20:39 +0000 (11:20 +0900)]
syscall: update BSD variants to sync with new os/signal

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

13 years agonet/http: fix client goroutine leak with persistent connections
Brad Fitzpatrick [Tue, 14 Feb 2012 01:48:56 +0000 (12:48 +1100)]
net/http: fix client goroutine leak with persistent connections

Thanks to Sascha Matzke & Florian Weimer for diagnosing.

R=golang-dev, adg, bradfitz, kevlar
CC=golang-dev
https://golang.org/cl/5656046

13 years agomime: unexport some internal details
Brad Fitzpatrick [Tue, 14 Feb 2012 01:48:28 +0000 (12:48 +1100)]
mime: unexport some internal details

Fixes #2941

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

13 years agocmd/api: fix typo.
Nigel Tao [Tue, 14 Feb 2012 01:37:57 +0000 (12:37 +1100)]
cmd/api: fix typo.

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

13 years agofix build for Linux/ARM.
Shenghou Ma [Tue, 14 Feb 2012 01:16:57 +0000 (20:16 -0500)]
fix build for Linux/ARM.
        1, IMO, the fatal error "regfree: not a register" from 5g when
         compiling runtime/debug.go is due to gcc miscompile, it doesn't
         show up when compiled with -O0. But I still haven't thought of
         a way to fix this, should all ARM builds be built with -O0?
        2, fixed mksysnum_linux.pl, so zsysnum_linux_arm.go no longer
        needs to be hand-generated.
        3, regen all in pkg syscall for Linux/ARM on Debian 6.0
This CL is somewhat big, I'd like to split it if necessary.

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

13 years agodoc: color comments
Andrew Gerrand [Tue, 14 Feb 2012 00:45:27 +0000 (11:45 +1100)]
doc: color comments

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

13 years agoarchive/zip: hide Write method from *Writer type
Andrew Gerrand [Mon, 13 Feb 2012 23:47:48 +0000 (10:47 +1100)]
archive/zip: hide Write method from *Writer type

This was an implementation detail that snuck into the public interface.
*Writer.Create gives you an io.Writer, the *Writer itself was never
meant to be written to.

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

13 years agoruntime, syscall: fix freebsd-386 build
Andrew Gerrand [Mon, 13 Feb 2012 23:04:59 +0000 (10:04 +1100)]
runtime, syscall: fix freebsd-386 build

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

13 years agonet/http: add a Linux-only sendfile test
Brad Fitzpatrick [Mon, 13 Feb 2012 22:34:52 +0000 (09:34 +1100)]
net/http: add a Linux-only sendfile test

I remembered that sendfile support was lacking a test.

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

13 years agoruntime, syscall: fix freebsd build
Andrew Gerrand [Mon, 13 Feb 2012 22:29:51 +0000 (09:29 +1100)]
runtime, syscall: fix freebsd build

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

13 years agocmd/cgo: omit //line in -godefs, -cdefs output
Russ Cox [Mon, 13 Feb 2012 21:02:13 +0000 (16:02 -0500)]
cmd/cgo: omit //line in -godefs, -cdefs output

Makes files like src/pkg/syscall/ztypes_linux_amd64.go easier to read.
(The copy that is checked in predates the //line output mode,
so this also preserves the status quo.)

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

13 years agofix: add fix for crypto type change
Russ Cox [Mon, 13 Feb 2012 21:01:34 +0000 (16:01 -0500)]
fix: add fix for crypto type change

Fixes #2905.

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

13 years agogc: delete old unsafe functions
Russ Cox [Mon, 13 Feb 2012 20:37:35 +0000 (15:37 -0500)]
gc: delete old unsafe functions

Also update build to be able to run mkbuiltin again.
The export form has changed a little, so builtin.c has
more diffs than unsafe.go.

In CL 5650069, I just edited the documentation, a rarely
successful method of change.

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

13 years agogo/doc: don't lose exported consts/vars with unexported type
Robert Griesemer [Mon, 13 Feb 2012 20:24:02 +0000 (12:24 -0800)]
go/doc: don't lose exported consts/vars with unexported type

Fixes #2998.

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

13 years agotext/template: drop reference to os.EPERM in the test
Rob Pike [Mon, 13 Feb 2012 20:11:39 +0000 (07:11 +1100)]
text/template: drop reference to os.EPERM in the test

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

13 years agogo/printer, gofmt: don't indent line directives
Robert Griesemer [Mon, 13 Feb 2012 19:50:53 +0000 (11:50 -0800)]
go/printer, gofmt: don't indent line directives

This was broken by https://golang.org/cl/5643066
which introduced lazy indentation printing.

Fixes #2990.

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

13 years agoexp/norm: fix typo
Shenghou Ma [Mon, 13 Feb 2012 19:50:06 +0000 (11:50 -0800)]
exp/norm: fix typo

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

13 years agospec: clarify implementation restrictions on untyped floats
Ian Lance Taylor [Mon, 13 Feb 2012 19:25:56 +0000 (11:25 -0800)]
spec: clarify implementation restrictions on untyped floats

Drop reference to "machine type."  Specify that integer
overflow must be an error.  Drop requirement that exponent
must be 128 bits--that's a lot.  Clarify that floating point
expressions may be rounded, including intermediate values.

This is a reworking of https://golang.org/cl/5577068/ .

Fixes #2789.

R=r, rsc, r, gri, ken, ken, iant
CC=golang-dev, remyoudompheng
https://golang.org/cl/5655049

13 years agoall: update 'gotest' to 'go test'
Shenghou Ma [Mon, 13 Feb 2012 18:58:17 +0000 (13:58 -0500)]
all: update 'gotest' to 'go test'

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

13 years ago8a, 8l: add LFENCE, MFENCE, SFENCE
Darren Elwood [Mon, 13 Feb 2012 18:58:12 +0000 (13:58 -0500)]
8a, 8l: add LFENCE, MFENCE, SFENCE

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

13 years agoA+C: Darren Elwood (individual CLA)
Russ Cox [Mon, 13 Feb 2012 18:58:05 +0000 (13:58 -0500)]
A+C: Darren Elwood (individual CLA)

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

13 years agoos/signal: selective signal handling
Russ Cox [Mon, 13 Feb 2012 18:52:37 +0000 (13:52 -0500)]
os/signal: selective signal handling

Restore package os/signal, with new API:
Notify replaces Incoming, allowing clients
to ask for certain signals only.  Also, signals
go to everyone who asks, not just one client.

This could plausibly move into package os now
that there are no magic side effects as a result
of the import.

Update runtime for new API: move common Unix
signal handling code into signal_unix.c.
(It's so easy to do this now that we don't have
to edit Makefiles!)

Tested on darwin,linux 386,amd64.

Fixes #1266.

R=r, dsymonds, bradfitz, iant, borman
CC=golang-dev
https://golang.org/cl/3749041

13 years agocrypto/...: more fixes for bug 2841
Adam Langley [Mon, 13 Feb 2012 17:38:45 +0000 (12:38 -0500)]
crypto/...: more fixes for bug 2841

1) Remove the Reset() member in crypto/aes and crypto/des (and
   document the change).
2) Turn several empty error structures into vars. Any remaining error
   structures are either non-empty, or will probably become so in the
   future.
3) Implement SetWriteDeadline for TLS sockets. At the moment, the TLS
   status cannot be reused after a Write error, which is probably fine
   for most uses.
4) Make crypto/aes and crypto/des return a cipher.Block.

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

13 years agoexp/norm: merged charinfo and decomposition tables. As a result only
Marcel van Lohuizen [Mon, 13 Feb 2012 13:54:46 +0000 (14:54 +0100)]
exp/norm: merged charinfo and decomposition tables. As a result only
one trie lookup per rune is needed. See forminfo.go for a description
of the new format.  Also included leading and trailing canonical
combining class in decomposition information.  This will often avoid
additional trie lookups.

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

13 years agospec: strings are more slices than arrays
Rob Pike [Mon, 13 Feb 2012 12:39:56 +0000 (23:39 +1100)]
spec: strings are more slices than arrays
Thanks to Aaron Kemp for noticing.

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

13 years agogodoc: new design
Andrew Gerrand [Mon, 13 Feb 2012 10:22:36 +0000 (21:22 +1100)]
godoc: new design

This is not the finished product,
but a good checkpoint from which to
proceed with further development.

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

13 years agomisc/dist: add binary distribution packaging script for linux
Andrew Gerrand [Mon, 13 Feb 2012 10:18:16 +0000 (21:18 +1100)]
misc/dist: add binary distribution packaging script for linux

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

13 years agogc, 8g, 8l: fix a handful of warnings
Anthony Martin [Mon, 13 Feb 2012 07:07:31 +0000 (23:07 -0800)]
gc, 8g, 8l: fix a handful of warnings

8g/cgen.c
        print format type mismatch

8l/asm.c
        resoff set and not used

gc/pgen.c
        misleading comparison INT > 0x80000000

gc/reflect.c
        dalgsym must be static to match forward declaration

gc/subr.c
        assumed_equal set and not used
        hashmem's second argument is not used

gc/walk.c
        duplicated (unreachable) code

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

13 years agosync/atomic: disable hammer pointer tests on wrong size system
Ian Lance Taylor [Mon, 13 Feb 2012 05:53:33 +0000 (21:53 -0800)]
sync/atomic: disable hammer pointer tests on wrong size system

hammerCompareAndSwapPointer64 was only passing on
little-endian systems.  hammerCompareAndSwapPointer32 was
writing 8 bytes to a uint32 value on the heap.

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

13 years agostrconv: disable issue 2917 test
Russ Cox [Mon, 13 Feb 2012 05:19:18 +0000 (00:19 -0500)]
strconv: disable issue 2917 test

It did in fact break on the darwin/386 builder.
Will investigate later; reopened issue 2917.

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

13 years agosyscall: make linux Dup2 match other systems
Russ Cox [Mon, 13 Feb 2012 05:11:36 +0000 (00:11 -0500)]
syscall: make linux Dup2 match other systems

You could argue for changing all the others, but
Linux is outvoted, and the only time it matters
is when newfd==-1, in which case you can call Dup.

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

13 years agocmd/fix: warn about exp, old, deleted packages
Russ Cox [Mon, 13 Feb 2012 04:55:33 +0000 (23:55 -0500)]
cmd/fix: warn about exp, old, deleted packages

Fixes #2776.

There was a previous attempt at CL 5592043 but that
seems to have stalled.  This one is simpler, and more up to date
(correct handling of spdy, for example).

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

13 years agonet/http: use mtime < t+1s to check for unmodified
Hong Ruiqi [Mon, 13 Feb 2012 04:45:19 +0000 (23:45 -0500)]
net/http: use mtime < t+1s to check for unmodified

The Date-Modified header truncates sub-second precision, so
use mtime < t+1s instead of mtime <= t to check for unmodified.

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

13 years agoA+C: Hong Ruiqi (individual CLA)
Hong Ruiqi [Mon, 13 Feb 2012 04:42:34 +0000 (23:42 -0500)]
A+C: Hong Ruiqi (individual CLA)

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

13 years agotesting: use runtime/debug to format panics
Russ Cox [Mon, 13 Feb 2012 04:41:07 +0000 (23:41 -0500)]
testing: use runtime/debug to format panics

Sorry, Mercurial failed me.

TBR=r, dsymonds
CC=golang-dev
https://golang.org/cl/5649080

13 years agotesting: use runtime/debug to format panics
Russ Cox [Mon, 13 Feb 2012 04:39:40 +0000 (23:39 -0500)]
testing: use runtime/debug to format panics

Among other things, this avoids putting a testing.go:nnn:
prefix on every line of the stack trace.

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

13 years agoruntime: delete Type and implementations (use reflect instead)
Russ Cox [Mon, 13 Feb 2012 04:26:20 +0000 (23:26 -0500)]
runtime: delete Type and implementations (use reflect instead)
unsafe: delete Typeof, Reflect, Unreflect, New, NewArray

Part of issue 2955 and issue 2968.

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

13 years agonet: avoid TCP self-connect
Russ Cox [Mon, 13 Feb 2012 04:25:55 +0000 (23:25 -0500)]
net: avoid TCP self-connect

Fixes #2690.

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

13 years agostrconv: add tests for issue 2917
Russ Cox [Mon, 13 Feb 2012 04:24:54 +0000 (23:24 -0500)]
strconv: add tests for issue 2917

Cannot reproduce the failure locally,
but add explicit test in case some other
machine can.

Fixes #2917 (for now).

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

13 years agonet/http/pprof: link to blog post
Rob Pike [Mon, 13 Feb 2012 04:24:06 +0000 (15:24 +1100)]
net/http/pprof: link to blog post

Fixes #2943.

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

13 years agonet/http: fix http_proxy parsing
Russ Cox [Mon, 13 Feb 2012 04:19:50 +0000 (23:19 -0500)]
net/http: fix http_proxy parsing

Fixes #2919.

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

13 years agocmd/go: respect test -timeout flag
Russ Cox [Mon, 13 Feb 2012 04:19:24 +0000 (23:19 -0500)]
cmd/go: respect test -timeout flag

I thought that -timeout was per-test, but it is for the
whole program execution, so cmd/go can adjust its timer
(also for whole program execution) accordingly.

Fixes #2993.

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

13 years agocmd/dist: encoding/gob is no longer required for cmd/go
Russ Cox [Mon, 13 Feb 2012 04:15:07 +0000 (23:15 -0500)]
cmd/dist: encoding/gob is no longer required for cmd/go

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

13 years agonet/http: document use of DetectContentType
Russ Cox [Mon, 13 Feb 2012 04:14:48 +0000 (23:14 -0500)]
net/http: document use of DetectContentType

Fixes #2365.

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

13 years agobuild: reject make.bash on Windows
Russ Cox [Mon, 13 Feb 2012 04:14:37 +0000 (23:14 -0500)]
build: reject make.bash on Windows

Also, echo cmd/dist during bootstrap build
Makes that phase look like all the others.

Fixes #2908.

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

13 years agogo spec: method names must be unique
Robert Griesemer [Mon, 13 Feb 2012 04:03:30 +0000 (20:03 -0800)]
go spec: method names must be unique

Fixes #2916.

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

13 years agonet: disable wild use of SO_REUSEPORT on BSD variants
Mikio Hara [Mon, 13 Feb 2012 03:45:59 +0000 (12:45 +0900)]
net: disable wild use of SO_REUSEPORT on BSD variants

Fixes #2830 (again).

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

13 years agospec: typographical adjustment for ellipsis
Rob Pike [Mon, 13 Feb 2012 03:38:31 +0000 (14:38 +1100)]
spec: typographical adjustment for ellipsis
The paragraph describing the ellipses presents the horizontal ellipsis
in two different fonts and at least on my screen they look too different.
Switch to a consistent rendering.

Of small steps are great journeys undertaken.

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

13 years agogodoc: static ids should be #lowercase
Rob Pike [Mon, 13 Feb 2012 03:34:30 +0000 (14:34 +1100)]
godoc: static ids should be #lowercase
so they don't collide with names like #Index.
Fixes #2970.

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

13 years agobuilder: really set $GOBUILDEXIT for Windows
Alex Brainman [Mon, 13 Feb 2012 03:32:45 +0000 (14:32 +1100)]
builder: really set $GOBUILDEXIT for Windows

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

13 years agoos: clarify docs for link functions
Gustavo Niemeyer [Mon, 13 Feb 2012 03:21:39 +0000 (01:21 -0200)]
os: clarify docs for link functions

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

13 years agostrings: more examples
Brad Fitzpatrick [Mon, 13 Feb 2012 03:05:57 +0000 (14:05 +1100)]
strings: more examples

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

13 years agogo1: fix old reference to Sys method
Rob Pike [Sun, 12 Feb 2012 21:05:53 +0000 (08:05 +1100)]
go1: fix old reference to Sys method
The example was fixed; the simplifying rewrite was missed.

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

13 years agopprof: fix import path in the documentation
Yves Junqueira [Sun, 12 Feb 2012 14:38:51 +0000 (12:38 -0200)]
pprof: fix import path in the documentation

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

13 years agonet: fix windows build
Mikio Hara [Sun, 12 Feb 2012 06:59:21 +0000 (15:59 +0900)]
net: fix windows build

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

13 years agobuild: get rid of deps.bash
Anthony Martin [Sun, 12 Feb 2012 04:02:50 +0000 (20:02 -0800)]
build: get rid of deps.bash

It doesn't work anymore and it's not used.

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

13 years agohtml/template: Added more explicit wording about examples and documentation.
Bjorn Tipling [Sun, 12 Feb 2012 01:18:00 +0000 (12:18 +1100)]
html/template: Added more explicit wording about examples and documentation.

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

13 years agogo1: update recipe for recovering Stat_t
Rob Pike [Sat, 11 Feb 2012 22:17:57 +0000 (09:17 +1100)]
go1: update recipe for recovering Stat_t

Fixes #2983.

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

13 years agoeffective_go: use new map deletion syntax
Rob Pike [Sat, 11 Feb 2012 22:11:44 +0000 (09:11 +1100)]
effective_go: use new map deletion syntax

Fixes #2984.

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

13 years agounsafe: Alignof and Offsetof now use the same style
Rob Pike [Sat, 11 Feb 2012 22:10:47 +0000 (09:10 +1100)]
unsafe: Alignof and Offsetof now use the same style

The easy part of issue 2968.

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

13 years agogc: diagnose field+method of same name
Russ Cox [Sat, 11 Feb 2012 06:21:12 +0000 (01:21 -0500)]
gc: diagnose field+method of same name

Fixes #2828.

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

13 years agogc: print detail for typechecking loop error
Russ Cox [Sat, 11 Feb 2012 06:04:33 +0000 (01:04 -0500)]
gc: print detail for typechecking loop error

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

13 years agogc: fix bug introduced earlier
Russ Cox [Sat, 11 Feb 2012 06:04:24 +0000 (01:04 -0500)]
gc: fix bug introduced earlier

Apparently l and $1 were the same register on Linux.
On the other systems, the compiler caught it.

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

13 years agogc: make constant arith errors a little more friendly
Russ Cox [Sat, 11 Feb 2012 05:50:56 +0000 (00:50 -0500)]
gc: make constant arith errors a little more friendly

Fixes #2804.

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

13 years agogofmt: fix error message in test
Robert Griesemer [Sat, 11 Feb 2012 05:47:18 +0000 (21:47 -0800)]
gofmt: fix error message in test

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

13 years agogc: fix import of struct type in struct literal
Russ Cox [Sat, 11 Feb 2012 05:34:01 +0000 (00:34 -0500)]
gc: fix import of struct type in struct literal

Fixes #2716.

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

13 years agoruntime: put lockorder before pollorder in Select memory block.
Ian Lance Taylor [Sat, 11 Feb 2012 05:24:14 +0000 (21:24 -0800)]
runtime: put lockorder before pollorder in Select memory block.

Otherwise lockorder may be misaligned, since lockorder is a
list of pointers and pollorder is a list of uint16.
Discovered running gccgo (which uses a modified copy of this
code) on SPARC.

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

13 years agogc: optimize interface ==, !=
Russ Cox [Sat, 11 Feb 2012 05:19:24 +0000 (00:19 -0500)]
gc: optimize interface ==, !=

If the values being compared have different concrete types,
then they're clearly unequal without needing to invoke the
actual interface compare routine.  This speeds tests for
specific values, like if err == io.EOF, by about 3x.

benchmark                  old ns/op    new ns/op    delta
BenchmarkIfaceCmp100             843          287  -65.95%
BenchmarkIfaceCmpNil100          184          182   -1.09%

Fixes #2591.

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

13 years ago5g: fix out of registers bug
Russ Cox [Sat, 11 Feb 2012 05:04:37 +0000 (00:04 -0500)]
5g: fix out of registers bug

Same fix as 6g, tripped by the 6g test case.

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

13 years agocmd/dist: clear execute bit from source file
Mikio Hara [Sat, 11 Feb 2012 04:23:44 +0000 (13:23 +0900)]
cmd/dist: clear execute bit from source file

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