]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agogo/token: fix data race on FileSet.last
Dave Cheney [Wed, 19 Dec 2012 21:26:24 +0000 (08:26 +1100)]
go/token: fix data race on FileSet.last

Fixes #4345.

Benchmarks are promising,

benchmark         old ns/op    new ns/op    delta
BenchmarkPrint     14716391     14747131   +0.21%

benchmark         old ns/op    new ns/op    delta
BenchmarkParse      8846219      8809343   -0.42%

benchmark          old MB/s     new MB/s  speedup
BenchmarkParse         6.61         6.64    1.00x

Also includes additional tests to improve token.FileSet coverage.

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

12 years agogo/token: add test for concurrent use of FileSet.Pos
Dave Cheney [Wed, 19 Dec 2012 00:38:00 +0000 (16:38 -0800)]
go/token: add test for concurrent use of FileSet.Pos

Update #4354.

Add a test to expose the race in the FileSet position cache.

R=dvyukov, gri
CC=fullung, golang-dev
https://golang.org/cl/6940078

12 years agoC: add Shawn Ledbetter (Google CLA)
Andrew Gerrand [Tue, 18 Dec 2012 23:14:05 +0000 (10:14 +1100)]
C: add Shawn Ledbetter (Google CLA)

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

12 years agoall: fix typos
Shenghou Ma [Tue, 18 Dec 2012 19:04:09 +0000 (03:04 +0800)]
all: fix typos
caught by https://github.com/lyda/misspell-check.

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

12 years agocmd/go: pass gccgoflags at the end of gccgo command line, warn if user passes the...
Shenghou Ma [Tue, 18 Dec 2012 17:48:09 +0000 (01:48 +0800)]
cmd/go: pass gccgoflags at the end of gccgo command line, warn if user passes the wrong toolchain options

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

12 years agoruntime: use "mp" and "gp" instead of "m" and "g" for local variable name to avoid...
Jingcheng Zhang [Tue, 18 Dec 2012 16:30:29 +0000 (00:30 +0800)]
runtime: use "mp" and "gp" instead of "m" and "g" for local variable name to avoid confusion with the global "m" and "g".

R=golang-dev, minux.ma, rsc
CC=bradfitz, golang-dev
https://golang.org/cl/6939064

12 years agoA+C: Eric Milliken (individual CLA)
Adam Langley [Tue, 18 Dec 2012 16:28:40 +0000 (11:28 -0500)]
A+C: Eric Milliken (individual CLA)

Generated by addca.

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

12 years agocmd/5l, cmd/6l, cmd/8l: fix function symbol generation from gcc compiled source code
Shenghou Ma [Tue, 18 Dec 2012 15:17:39 +0000 (23:17 +0800)]
cmd/5l, cmd/6l, cmd/8l: fix function symbol generation from gcc compiled source code
For CL 6853059.

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

12 years agoruntime: use clock_gettime to get ns resolution for time.now & runtime.nanotime
Shenghou Ma [Tue, 18 Dec 2012 14:57:25 +0000 (22:57 +0800)]
runtime: use clock_gettime to get ns resolution for time.now & runtime.nanotime

For Linux/{386,arm}, FreeBSD/{386,amd64,arm}, NetBSD/{386,amd64}, OpenBSD/{386,amd64}.
Note: our Darwin implementation already has ns resolution.

Linux/386 (Core i7-2600 @ 3.40GHz, kernel 3.5.2-gentoo)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow          110          118   +7.27%

Linux/ARM (ARM Cortex-A8 @ 800MHz, kernel 2.6.32.28 android)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow          625          542  -13.28%

Linux/ARM (ARM Cortex-A9 @ 1GHz, Pandaboard)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow          992          909   -8.37%

FreeBSD 9-REL-p1/amd64 (Dell R610 Server with Xeon X5650 @ 2.67GHz)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow          699          695   -0.57%

FreeBSD 9-REL-p1/amd64 (Atom D525 @ 1.80GHz)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow         1553         1658   +6.76%

OpenBSD/amd64 (Dell E6410 with i5 CPU M 540 @ 2.53GHz)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow         1262         1236   -2.06%

OpenBSD/i386 (Asus eeePC 701 with Intel Celeron M 900MHz - locked to 631MHz)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow         5089         5043   -0.90%

NetBSD/i386 (VMware VM with Core i5 CPU @ 2.7GHz)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow          277          278   +0.36%

NetBSD/amd64 (VMware VM with Core i5 CPU @ 2.7Ghz)
benchmark       old ns/op    new ns/op    delta
BenchmarkNow          103          105   +1.94%

Thanks Maxim Khitrov, Joel Sing, and Dave Cheney for providing benchmark data.

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

12 years agogo/doc: add "hdr-" prefix to headers generated from package overviews.
David Symonds [Tue, 18 Dec 2012 01:19:04 +0000 (12:19 +1100)]
go/doc: add "hdr-" prefix to headers generated from package overviews.

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

12 years agoexp/gotype: disable failing tests and add a few more
Robert Griesemer [Mon, 17 Dec 2012 22:32:46 +0000 (14:32 -0800)]
exp/gotype: disable failing tests and add a few more

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

12 years agocmd/6g: fix componentgen for funarg structs.
Rémy Oudompheng [Mon, 17 Dec 2012 21:29:43 +0000 (22:29 +0100)]
cmd/6g: fix componentgen for funarg structs.

Fixes #4518.

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

12 years agodebug/elf: handle missing shstrndx in core files
Dave Cheney [Mon, 17 Dec 2012 20:58:22 +0000 (07:58 +1100)]
debug/elf: handle missing shstrndx in core files

Fixes #4481.

hello-world-core.gz was generated with a simple hello world c program and core dumped as suggested in the issue.

Also: add support for gz compressed test fixtures.

R=minux.ma, rsc, iant
CC=golang-dev
https://golang.org/cl/6936058

12 years agotime: fix panic with time.Parse(time.StampNano, ... )
Dave Cheney [Mon, 17 Dec 2012 20:52:23 +0000 (07:52 +1100)]
time: fix panic with time.Parse(time.StampNano, ... )

Fixes #4502.

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

12 years agonet/http: fix goroutine leak in error case
Brad Fitzpatrick [Mon, 17 Dec 2012 20:01:00 +0000 (12:01 -0800)]
net/http: fix goroutine leak in error case

Fixes #4531

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

12 years agoexp/types: completed typechecking of parameter passing
Robert Griesemer [Mon, 17 Dec 2012 19:35:59 +0000 (11:35 -0800)]
exp/types: completed typechecking of parameter passing

Details:
- fixed variadic parameter passing and calls of the form f(g())
- fixed implementation of ^x for unsigned constants x
- fixed assignability of untyped booleans
- resolved a few TODOs, various minor fixes
- enabled many more tests (only 6 std packages don't typecheck)

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

12 years agocmd/gc: add GOEXPERIMENT=zerostack to clear stack on function entry
Russ Cox [Mon, 17 Dec 2012 19:32:26 +0000 (14:32 -0500)]
cmd/gc: add GOEXPERIMENT=zerostack to clear stack on function entry

This is expensive but it might be useful in cases where
people are suffering from false positives during garbage
collection and are willing to trade the CPU time for getting
rid of the false positives.

On the other hand it only eliminates false positives caused
by other function calls, not false positives caused by dead
temporaries stored in the current function call.

The 5g/6g/8g changes were pulled out of the history, from
the last time we needed to do this (to work around a goto bug).
The code in go.h, lex.c, pgen.c is new but tiny.

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

12 years agofmt, encoding/gob: fix misuse of Read
Shenghou Ma [Mon, 17 Dec 2012 17:26:48 +0000 (01:26 +0800)]
fmt, encoding/gob: fix misuse of Read
reader.Read() can return both 0,nil and len(buf),err.
To be safe, we use io.ReadFull instead of doing reader.Read directly.

Fixes #3472.

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

12 years agosyscall: lazily populate the environment cache on Plan 9
Anthony Martin [Mon, 17 Dec 2012 16:33:51 +0000 (08:33 -0800)]
syscall: lazily populate the environment cache on Plan 9

This decreases the amount of system calls during the
first call to Getenv. Calling Environ will still read
in all environment variables and populate the cache.

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

12 years agocmd/cgo: access errno from void C function
Shenghou Ma [Mon, 17 Dec 2012 16:26:08 +0000 (00:26 +0800)]
cmd/cgo: access errno from void C function
Fixes #3729.

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

12 years agoruntime: implement getenv for Plan 9
Anthony Martin [Mon, 17 Dec 2012 16:07:40 +0000 (11:07 -0500)]
runtime: implement getenv for Plan 9

With this change the runtime can now read GOMAXPROCS, GOGC, etc.

I'm not quite sure how we missed this.

R=seed, lucio.dere, rsc
CC=golang-dev
https://golang.org/cl/6935062

12 years agotest: add "duplicate" struct map key test
Russ Cox [Mon, 17 Dec 2012 16:05:58 +0000 (11:05 -0500)]
test: add "duplicate" struct map key test

Update #4555.

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

12 years agonet/smtp: remove data race from TestSendMail.
Rick Arnold [Mon, 17 Dec 2012 15:45:33 +0000 (10:45 -0500)]
net/smtp: remove data race from TestSendMail.

A data race was found in TestSendMail by the race detector.

Fixes #4559.

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

12 years agoos: fix docs for Expand
Shenghou Ma [Mon, 17 Dec 2012 15:37:02 +0000 (23:37 +0800)]
os: fix docs for Expand
there is no concept of “undefined” variables for Expand。

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

12 years agonet/http/pprof: fix doc for /debug/pprof/
Shenghou Ma [Mon, 17 Dec 2012 15:32:08 +0000 (23:32 +0800)]
net/http/pprof: fix doc for /debug/pprof/
Fixes #4548.

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

12 years agoapi/next.txt: update
Shenghou Ma [Mon, 17 Dec 2012 15:01:36 +0000 (23:01 +0800)]
api/next.txt: update

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

12 years agosyscall: document that documentation is platform specific
Christopher Nielsen [Mon, 17 Dec 2012 14:50:00 +0000 (22:50 +0800)]
syscall: document that documentation is platform specific

Fixes #4051

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

12 years agocmd/gc: racewalk: fix compiler crash
Dmitriy Vyukov [Mon, 17 Dec 2012 08:55:41 +0000 (12:55 +0400)]
cmd/gc: racewalk: fix compiler crash
The code:
func main() {
        v := make([]int64, 10)
        i := 1
        _ = v[(i*4)/3]
}
crashes compiler with:

Program received signal SIGSEGV, Segmentation fault.
0x000000000043c274 in walkexpr (np=0x7fffffffc9b8, init=0x0) at src/cmd/gc/walk.c:587
587 *init = concat(*init, n->ninit);
(gdb) bt
#0  0x000000000043c274 in walkexpr (np=0x7fffffffc9b8, init=0x0) at src/cmd/gc/walk.c:587
#1  0x0000000000432d15 in copyexpr (n=0x7ffff7f69a48, t=<optimized out>, init=0x0) at src/cmd/gc/subr.c:2020
#2  0x000000000043f281 in walkdiv (init=0x0, np=0x7fffffffca70) at src/cmd/gc/walk.c:2901
#3  walkexpr (np=0x7ffff7f69760, init=0x0) at src/cmd/gc/walk.c:956
#4  0x000000000043d801 in walkexpr (np=0x7ffff7f69bc0, init=0x0) at src/cmd/gc/walk.c:988
#5  0x000000000043cc9b in walkexpr (np=0x7ffff7f69d38, init=0x0) at src/cmd/gc/walk.c:1068
#6  0x000000000043c50b in walkexpr (np=0x7ffff7f69f50, init=0x0) at src/cmd/gc/walk.c:879
#7  0x000000000043c50b in walkexpr (np=0x7ffff7f6a0c8, init=0x0) at src/cmd/gc/walk.c:879
#8  0x0000000000440a53 in walkexprlist (l=0x7ffff7f6a0c8, init=0x0) at src/cmd/gc/walk.c:357
#9  0x000000000043d0bf in walkexpr (np=0x7fffffffd318, init=0x0) at src/cmd/gc/walk.c:566
#10 0x00000000004402bf in vmkcall (fn=<optimized out>, t=0x0, init=0x0, va=0x7fffffffd368) at src/cmd/gc/walk.c:2275
#11 0x000000000044059a in mkcall (name=<optimized out>, t=0x0, init=0x0) at src/cmd/gc/walk.c:2287
#12 0x000000000042862b in callinstr (np=0x7fffffffd4c8, init=0x7fffffffd568, wr=0, skip=<optimized out>) at src/cmd/gc/racewalk.c:478
#13 0x00000000004288b7 in racewalknode (np=0x7ffff7f68108, init=0x7fffffffd568, wr=0, skip=0) at src/cmd/gc/racewalk.c:287
#14 0x0000000000428781 in racewalknode (np=0x7ffff7f65840, init=0x7fffffffd568, wr=0, skip=0) at src/cmd/gc/racewalk.c:302
#15 0x0000000000428abd in racewalklist (l=0x7ffff7f65840, init=0x0) at src/cmd/gc/racewalk.c:97
#16 0x0000000000428d0b in racewalk (fn=0x7ffff7f5f010) at src/cmd/gc/racewalk.c:63
#17 0x0000000000402b9c in compile (fn=0x7ffff7f5f010) at src/cmd/6g/../gc/pgen.c:67
#18 0x0000000000419f86 in funccompile (n=0x7ffff7f5f010, isclosure=0) at src/cmd/gc/dcl.c:1414
#19 0x0000000000424161 in p9main (argc=<optimized out>, argv=<optimized out>) at src/cmd/gc/lex.c:431
#20 0x0000000000401739 in main (argc=<optimized out>, argv=<optimized out>) at src/lib9/main.c:35

The problem is nil init passed to mkcall().

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

12 years agofmt: fix a typo
Oling Cat [Mon, 17 Dec 2012 07:13:12 +0000 (18:13 +1100)]
fmt: fix a typo

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

12 years agoencoding/json: cleanup leftover redundant variables.
Rémy Oudompheng [Mon, 17 Dec 2012 01:34:49 +0000 (02:34 +0100)]
encoding/json: cleanup leftover redundant variables.

Those variables come from ancient times when reflect.Value was
an interface.

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

12 years agonet/smtp: add optional Hello method
Rick Arnold [Mon, 17 Dec 2012 01:19:35 +0000 (20:19 -0500)]
net/smtp: add optional Hello method

Add a Hello method that allows clients to set the server sent in the EHLO/HELO exchange; the default remains localhost.
Based on CL 5555045 by rsc.

Fixes #4219.

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

12 years agoruntime: struct Obj in mgc0.c and buffers in scanblock()
Jan Ziak [Mon, 17 Dec 2012 00:32:12 +0000 (19:32 -0500)]
runtime: struct Obj in mgc0.c and buffers in scanblock()

Details:

- This CL is the conceptual skeleton of code found in CL 6114046

- The garbage collector uses struct Obj to specify memory blocks

- scanblock() is putting found memory blocks into an intermediate buffer
  (xbuf) before adding/flushing them to the main work buffer (wbuf)

- The main loop in scanblock() is replaced with a skeleton code that
  in the future will be able to recognize the type of objects and
  thus will improve the garbage collector's precision.
  For now, all objects are simply sequences of pointers so
  the precision of the garbage collector remains unchanged.

- The code plugs .gcdata and .gcbss sections into the garbage collector.
  scanblock() in this CL is unable to make any use of this.

R=rsc, dvyukov, remyoudompheng
CC=dave, golang-dev, minux.ma
https://golang.org/cl/6856121

12 years agocmd/fix: Add keys to printer.Config composite literals.
Christopher Cahoon [Mon, 17 Dec 2012 00:31:59 +0000 (19:31 -0500)]
cmd/fix: Add keys to printer.Config composite literals.

Fixes #4499.

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

12 years agoA+C: Christopher Cahoon (individual CLA)
Russ Cox [Mon, 17 Dec 2012 00:17:50 +0000 (19:17 -0500)]
A+C: Christopher Cahoon (individual CLA)

Generated by addca.

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

12 years agoA+C: Alexander Surma (individual CLA)
Andrew Gerrand [Sun, 16 Dec 2012 22:11:26 +0000 (09:11 +1100)]
A+C: Alexander Surma (individual CLA)

Generated by addca.

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

12 years agonet: change ListenUnixgram signature to return UnixConn instead of UDPConn
Mikio Hara [Sun, 16 Dec 2012 02:51:47 +0000 (11:51 +0900)]
net: change ListenUnixgram signature to return UnixConn instead of UDPConn

This CL breaks Go 1 API compatibility but it doesn't matter because
previous ListenUnixgram doesn't work in any use cases, oops.

The public API change is:
-pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error)
+pkg net, func ListenUnixgram(string, *UnixAddr) (*UnixConn, error)

Fixes #3875.

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

12 years agocmd/gc: fix defaultlit of shifts used in interface context.
Rémy Oudompheng [Sat, 15 Dec 2012 18:37:59 +0000 (19:37 +0100)]
cmd/gc: fix defaultlit of shifts used in interface context.

Fixes #4545.

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

12 years agosrc: gofmt -w -s
Mikio Hara [Sat, 15 Dec 2012 05:19:51 +0000 (14:19 +0900)]
src: gofmt -w -s

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

12 years agobuiltin: correct comment on builtin function delete().
Jingcheng Zhang [Fri, 14 Dec 2012 17:13:42 +0000 (09:13 -0800)]
builtin: correct comment on builtin function delete().

Delete on a nil map is now a no-op.

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

12 years agoA+C: Casey Marshall (individual CLA)
Adam Langley [Fri, 14 Dec 2012 17:04:08 +0000 (12:04 -0500)]
A+C: Casey Marshall (individual CLA)

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

12 years agodatabase/sql: adds test for fix in issue 4433.
James David Chalfant [Fri, 14 Dec 2012 17:00:33 +0000 (09:00 -0800)]
database/sql: adds test for fix in issue 4433.

Tests that here should be automatic retries if a database
driver's connection returns ErrBadConn on Begin. See
"TestTxErrBadConn" in sql_test.go

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

12 years agoruntime/race: update runtime to r170112.
Dmitriy Vyukov [Fri, 14 Dec 2012 09:40:59 +0000 (13:40 +0400)]
runtime/race: update runtime to r170112.
This includes GORACE history_size and log_path flags.

This change is actually an addition to:
https://golang.org/cl/6947046

race_linux_amd64.syso somehow fall out of it.

R=minux.ma
CC=golang-dev
https://golang.org/cl/6946051

12 years agoruntime/race: update runtime to r170112.
Dmitriy Vyukov [Fri, 14 Dec 2012 09:23:43 +0000 (13:23 +0400)]
runtime/race: update runtime to r170112.
This includes GORACE history_size and log_path flags.

R=golang-dev, bradfitz, rsc, remyoudompheng, minux.ma
CC=golang-dev
https://golang.org/cl/6947046

12 years agocmd/go: handle os signals
Alex Brainman [Fri, 14 Dec 2012 06:33:59 +0000 (17:33 +1100)]
cmd/go: handle os signals

Ignore signals during "go run" and wait for running child
process to exit. Stop executing further tests during "go test",
wait for running tests to exit and report error exit code.

Original CL 6351053 by dfc.

Fixes #3572.
Fixes #3581.

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

12 years agotest: s/float/float32/
Ian Lance Taylor [Thu, 13 Dec 2012 23:11:31 +0000 (15:11 -0800)]
test: s/float/float32/

I just committed a patch to gccgo that notices that float was
never defined, causing an additional unmatched error message.
Rename the type to avoid that message.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6947049

12 years agoos: Improve the accuracy of os.Chtimes
Nick Craig-Wood [Thu, 13 Dec 2012 21:02:39 +0000 (13:02 -0800)]
os: Improve the accuracy of os.Chtimes

I've been writing some code which involves syncing files (like
rsync) and it became apparent that under Linux I could read
modification times (os.Lstat) with nanosecond precision but
only write them with microsecond precision.  This difference
in precision is rather annoying when trying to discover
whether files need syncing or not!

I've patched syscall and os to increases the accuracy of of
os.Chtimes for Linux and Windows.  This involved exposing the
utimensat system call under Linux and a bit of extra code
under Windows.  I decided not to expose the "at" bit of the
system call as it is impossible to replicate under Windows, so
the patch adds syscall.Utimens() to all architectures along
with a ImplementsUtimens flag.

If the utimensat syscall isn't available (utimensat was added
to Linux in 2.6.22, Released, 8 July 2007) then it silently
falls back to the microsecond accuracy version it uses now.
The improved accuracy for Windows should be good for all
versions of Windows.

Unfortunately Darwin doesn't seem to have a utimensat system
call that I could find so I couldn't implement it there.  The
BSDs do, but since they share their syscall implementation
with Darwin I couldn't figure out how to define a syscall for
*BSD and not Darwin.  I've left this as a TODO in the code.

In the process I implemented the missing methods for Timespec
under Windows which I needed which just happened to round out
the Timespec API for all platforms!

------------------------------------------------------------

Test code: http://play.golang.org/p/1xnGuYOi4b

Linux Before (1000 ns precision)

$ ./utimetest.linux.before z
Setting mtime 1344937903123456789: 2012-08-14 10:51:43.123456789 +0100 BST
Reading mtime 1344937903123457000: 2012-08-14 10:51:43.123457 +0100 BST

Linux After (1 ns precision)

$ ./utimetest.linux.after z
Setting mtime 1344937903123456789: 2012-08-14 10:51:43.123456789 +0100 BST
Reading mtime 1344937903123456789: 2012-08-14 10:51:43.123456789 +0100 BST

Windows Before (1000 ns precision)

X:\>utimetest.windows.before.exe c:\Test.txt
Setting mtime 1344937903123456789: 2012-08-14 10:51:43.123456789 +0100 GMTDT
Reading mtime 1344937903123456000: 2012-08-14 10:51:43.123456 +0100 GMTDT

Windows After (100 ns precision)

X:\>utimetest.windows.after.exe c:\Test.txt
Setting mtime 1344937903123456789: 2012-08-14 10:51:43.123456789 +0100 GMTDT
Reading mtime 1344937903123456700: 2012-08-14 10:51:43.1234567 +0100 GMTDT

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

12 years agoA+C: Nick Craig-Wood (individual CLA)
Brad Fitzpatrick [Thu, 13 Dec 2012 20:59:11 +0000 (12:59 -0800)]
A+C: Nick Craig-Wood (individual CLA)

Generated by addca.

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

12 years agotest: move map delete test to nil.go
Ian Lance Taylor [Thu, 13 Dec 2012 20:11:24 +0000 (12:11 -0800)]
test: move map delete test to nil.go

No need for a separate test for this.

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

12 years agocmd/{5,6,8}g: reduce size of Prog and Addr
Dave Cheney [Thu, 13 Dec 2012 19:20:24 +0000 (06:20 +1100)]
cmd/{5,6,8}g: reduce size of Prog and Addr

5g: Prog went from 128 bytes to 88 bytes
6g: Prog went from 174 bytes to 144 bytes
8g: Prog went from 124 bytes to 92 bytes

There may be a little more that can be squeezed out of Addr, but alignment will be a factor.

All: remove the unused pun field from Addr

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

12 years agotest/nil.go: delete on nil maps no longer panics
Shenghou Ma [Thu, 13 Dec 2012 18:19:33 +0000 (02:19 +0800)]
test/nil.go: delete on nil maps no longer panics
Fix the build.

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

12 years agoruntime: deletion on nil maps is a no-op now
Shenghou Ma [Thu, 13 Dec 2012 15:48:48 +0000 (23:48 +0800)]
runtime: deletion on nil maps is a no-op now
Fixes #4535.

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

12 years agolib/godoc/example.html: htmlify the play code
Shenghou Ma [Thu, 13 Dec 2012 11:08:51 +0000 (19:08 +0800)]
lib/godoc/example.html: htmlify the play code
Fixes #4539.

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

12 years agoio: SectionReader.ReadAt should return EOF when buf is not fully read
Shenghou Ma [Thu, 13 Dec 2012 10:36:24 +0000 (18:36 +0800)]
io: SectionReader.ReadAt should return EOF when buf is not fully read
Fixes #4392.

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

12 years agonet: make TestDialTimeoutFDLeak a bit robust
Mikio Hara [Thu, 13 Dec 2012 07:21:25 +0000 (16:21 +0900)]
net: make TestDialTimeoutFDLeak a bit robust

TestDialTimeoutFDLeak will fail when system state somaxconn is
greater than expected fixed value.

Fixes #4384 (again).

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

12 years agoruntime/race: fix test for GOMAXPROCS>1
Albert Strasheim [Thu, 13 Dec 2012 06:14:32 +0000 (10:14 +0400)]
runtime/race: fix test for GOMAXPROCS>1

Fixes #4530.

R=dvyukov, dave
CC=golang-dev
https://golang.org/cl/6933052

12 years ago database/sql: Alter *DB.begin to return driver.ErrBadConn when driver.Conn.Begin...
James David Chalfant [Thu, 13 Dec 2012 06:04:55 +0000 (22:04 -0800)]
database/sql: Alter *DB.begin to return driver.ErrBadConn when driver.Conn.Begin returns driver.ErrBadConn
Fixes #4433

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

12 years agoA+C: James David Chalfant (individual CLA)
Brad Fitzpatrick [Thu, 13 Dec 2012 06:04:24 +0000 (22:04 -0800)]
A+C: James David Chalfant (individual CLA)

Generated by addca.

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

12 years agolog/syslog: fix flakey test on slow hosts
Dave Cheney [Thu, 13 Dec 2012 05:26:20 +0000 (16:26 +1100)]
log/syslog: fix flakey test on slow hosts

Fixes #4467.

The syslog tests can fail if the timeout fires before the data arrives at the mock server. Moving the timeout onto the goroutine that is calling ReadFrom() and always processing the data returned before handling the error should improve the reliability of the test.

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

12 years agogo/doc: hide "Program exited." message from front page playground output
Andrew Gerrand [Thu, 13 Dec 2012 04:35:38 +0000 (15:35 +1100)]
go/doc: hide "Program exited." message from front page playground output

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

12 years agodoc/play: sync playground.js with go-playground repo
Andrew Gerrand [Thu, 13 Dec 2012 03:32:03 +0000 (14:32 +1100)]
doc/play: sync playground.js with go-playground repo

Also add style for "Program exited." message.

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

12 years agospec: more explicit comments for constant expression examples
Robert Griesemer [Wed, 12 Dec 2012 22:25:40 +0000 (14:25 -0800)]
spec: more explicit comments for constant expression examples

Fixes #3814.

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

12 years agospec: calling delete on a nil map is a no-op
Robert Griesemer [Wed, 12 Dec 2012 21:08:35 +0000 (13:08 -0800)]
spec: calling delete on a nil map is a no-op

This is language change. It is a backward-compatible
change but for code that relies on a run-time panic
when calling delete on a nil map (unlikely).

Fixes #4253.

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

12 years agonet/http: return nicer error when Client request Host is blank
Brad Fitzpatrick [Wed, 12 Dec 2012 20:23:01 +0000 (12:23 -0800)]
net/http: return nicer error when Client request Host is blank

Update #4271

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

12 years agonet/http: remove a stale cookie TODO comment, add a test
Brad Fitzpatrick [Wed, 12 Dec 2012 19:36:44 +0000 (11:36 -0800)]
net/http: remove a stale cookie TODO comment, add a test

Fixes #4528

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

12 years agomisc/dashboard: don't email about netbsd failures
Brad Fitzpatrick [Wed, 12 Dec 2012 19:33:03 +0000 (11:33 -0800)]
misc/dashboard: don't email about netbsd failures

Too flaky.

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

12 years agonet/http: follow certain redirects after POST requests
Brad Fitzpatrick [Wed, 12 Dec 2012 19:09:55 +0000 (11:09 -0800)]
net/http: follow certain redirects after POST requests

Fixes #4145

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

12 years agospec: index and array/slice size constants must fit into an int
Robert Griesemer [Wed, 12 Dec 2012 19:06:26 +0000 (11:06 -0800)]
spec: index and array/slice size constants must fit into an int

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

12 years agodoc/gopher: add high-resolution pencil sketches
Rob Pike [Wed, 12 Dec 2012 18:51:13 +0000 (10:51 -0800)]
doc/gopher: add high-resolution pencil sketches
These are higher-resolution scans of the little
drawings used as clip art on golang.org

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

12 years agocmd/gc: Give better line numbers for errors in composite literals.
Daniel Morsing [Wed, 12 Dec 2012 15:43:54 +0000 (16:43 +0100)]
cmd/gc: Give better line numbers for errors in composite literals.

Credit to Russ for suggesting this fix.

Fixes #3925.

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

12 years agogo/build: give better explanation for "cannot find package"
Dave Cheney [Wed, 12 Dec 2012 10:38:52 +0000 (21:38 +1100)]
go/build: give better explanation for "cannot find package"

Fixes #4079.

Some example output:

% go install foo/bar
can't load package: package foo/bar: cannot find package "foo/bar" in any of:
        /home/dfc/go/src/pkg/foo/bar (from $GOROOT)
        /home/dfc/src/foo/bar (from $GOPATH)
        /home/dfc/src2/src/foo/bar

% GOPATH= go install foo/bar
can't load package: package foo/bar: cannot find package "foo/bar" in any of:
/home/dfc/go/src/pkg/foo/bar (from $GOROOT)
($GOPATH not set)

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

12 years agocmd/5g: avoid temporary during OMINUS
Dave Cheney [Wed, 12 Dec 2012 08:25:22 +0000 (19:25 +1100)]
cmd/5g: avoid temporary during OMINUS

Saves one MOVW and one register during the fast div/mod introduced in CL 6819123.

linux/arm (armv5)

benchmark               old ns/op    new ns/op    delta
BenchmarkInt64Mod1             12           12   +7.50%
BenchmarkUint16Mod2             7            7   +0.28%
BenchmarkUint16Mod4             7            7   -0.28%
BenchmarkUint64Mod1            15           11  -23.72%
BenchmarkInt8Neg                8            7  -17.66%
BenchmarkInt16Neg               8            7  -17.66%
BenchmarkInt32Neg               5            5   -9.04%
BenchmarkUint8Neg               7            6  -14.35%
BenchmarkUint16Neg              8            7  -17.66%
BenchmarkUint32Neg              5            5   -9.04%

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

12 years agocmd/gc: don't import the same package multiple times.
Rémy Oudompheng [Wed, 12 Dec 2012 07:47:09 +0000 (08:47 +0100)]
cmd/gc: don't import the same package multiple times.

Implementation suggested by DMorsing.

R=golang-dev, dave, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/6903059

12 years agocmd/6g, cmd/8g: simplify integer division code.
Rémy Oudompheng [Wed, 12 Dec 2012 07:35:08 +0000 (08:35 +0100)]
cmd/6g, cmd/8g: simplify integer division code.

Change suggested by iant. The compiler generates
special code for a/b when a is -0x80...0 and b = -1.
A single instruction can cover the case where b is -1,
so only one comparison is needed.

Fixes #3551.

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

12 years agonet: TestDialTimeoutFDLeak failure
Dave Cheney [Tue, 11 Dec 2012 20:25:07 +0000 (07:25 +1100)]
net: TestDialTimeoutFDLeak failure

Fixes #4384.

Implments the suggestion by rsc in comment 15, http://code.google.com/p/go/issues/detail?id=4384#c15

An alternate suggestion would be to temporarily set GOMAXPROCS to 1 during this test.

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

12 years agolib/codereview: suggest argument to hg mail / hg submit
Russ Cox [Tue, 11 Dec 2012 18:36:55 +0000 (13:36 -0500)]
lib/codereview: suggest argument to hg mail / hg submit

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

12 years agodoc/contribute: mention 'hg help codereview'
Russ Cox [Tue, 11 Dec 2012 18:36:43 +0000 (13:36 -0500)]
doc/contribute: mention 'hg help codereview'

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

12 years agoencoding/csv: add Error method to Writer
Ryan Slade [Tue, 11 Dec 2012 18:29:13 +0000 (13:29 -0500)]
encoding/csv: add Error method to Writer

Fixed issue 3931

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

12 years agoA+C: Ryan Slade (individual CLA)
Russ Cox [Tue, 11 Dec 2012 18:28:44 +0000 (13:28 -0500)]
A+C: Ryan Slade (individual CLA)

Generated by addca.

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

12 years agoexp/types: filling in more blanks
Robert Griesemer [Tue, 11 Dec 2012 18:17:33 +0000 (10:17 -0800)]
exp/types: filling in more blanks

- implemented built-in complex()
- implemented missing expression switch checks

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

12 years agocmd/gc: merge casep and casee labels
Miquel Sabaté Solà [Tue, 11 Dec 2012 17:23:04 +0000 (12:23 -0500)]
cmd/gc: merge casep and casee labels

The code inside the casee and casep labels can perfectly be merged since
they essentially do the same. The character to be stored where cp points is
just the character contained by the c variable.

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

12 years agoregexp: re-enable TestBadCompile
Russ Cox [Tue, 11 Dec 2012 17:19:39 +0000 (12:19 -0500)]
regexp: re-enable TestBadCompile

The code that was commented out was for the old regexp package.
In the new one the errors and the space of valid regexps are different.

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

12 years agomath/big: add SetUint64 and Uint64 functions to *Int
Luit van Drongelen [Tue, 11 Dec 2012 17:19:10 +0000 (12:19 -0500)]
math/big: add SetUint64 and Uint64 functions to *Int

Implementation is mostly identical to passing a non-negative int64 to
SetInt64, and calling Int64 with a non-negative value in the *Int.
Fixes #4389.

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

12 years agospec: Correct typo in method expressions example.
Robin Eklind [Tue, 11 Dec 2012 17:17:53 +0000 (12:17 -0500)]
spec: Correct typo in method expressions example.

Also, remove unnecessary whitespace.

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

12 years agonet/http, net/url: permit Request-URI "*"
Brad Fitzpatrick [Tue, 11 Dec 2012 17:07:27 +0000 (12:07 -0500)]
net/http, net/url: permit Request-URI "*"

Also, implement a global OPTIONS * handler, like Apache.

Permit sending "*" requests to handlers, but not path-based
(ServeMux) handlers.  That means people can go out of their
way to support SSDP or SIP or whatever, but most users will be
unaffected.

See RFC 2616 Section 5.1.2 (Request-URI)
See RFC 2616 Section 9.2 (OPTIONS)

Fixes #3692

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

12 years agosyscall: let mkall.sh work on multiarch systems (like Precise)
Brad Fitzpatrick [Tue, 11 Dec 2012 17:03:18 +0000 (12:03 -0500)]
syscall: let mkall.sh work on multiarch systems (like Precise)

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

12 years agoregexp/syntax: export ErrUnexpectedParen
Brian Ketelsen [Tue, 11 Dec 2012 17:02:14 +0000 (12:02 -0500)]
regexp/syntax: export ErrUnexpectedParen

Fixes #3712

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

12 years agoA+C: Brian Ketelsen and Miquel Sabaté Solà (individual CLA × 2)
Russ Cox [Tue, 11 Dec 2012 17:02:07 +0000 (12:02 -0500)]
A+C: Brian Ketelsen and Miquel Sabaté Solà (individual CLA × 2)

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

12 years agofmt: fix %v of complex slice
Russ Cox [Tue, 11 Dec 2012 16:49:41 +0000 (11:49 -0500)]
fmt: fix %v of complex slice

Fixes #4525.

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

12 years agoencoding/base64: new example for NewEncoder with emphasis on Close
Shenghou Ma [Tue, 11 Dec 2012 16:49:02 +0000 (11:49 -0500)]
encoding/base64: new example for NewEncoder with emphasis on Close
Fixes #4394.

R=iant, bradfitz, rsc, remigius.gieben
CC=golang-dev
https://golang.org/cl/6847125

12 years agocmd/gc: remove bad check for BADWIDTH
Daniel Morsing [Tue, 11 Dec 2012 16:36:10 +0000 (17:36 +0100)]
cmd/gc: remove bad check for BADWIDTH

This check for BADWIDTH might happen while in defercheckwidth, making it raise errors for non-erroneous situations.

Fixes #4495.

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

12 years agonet/url: fix handling of relative paths in ResolveReference.
Rick Arnold [Tue, 11 Dec 2012 16:06:07 +0000 (11:06 -0500)]
net/url: fix handling of relative paths in ResolveReference.

Fixes #3560.

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

12 years agogodoc: move example list into index section
Russ Cox [Tue, 11 Dec 2012 01:20:00 +0000 (20:20 -0500)]
godoc: move example list into index section

Putting it before the Index (where it is now) is wrong:
we don't even know what's in the package yet.

Fixes #4484.

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

12 years agodoc/go1.1.html: add warning about net.ResolveTCPAddr error checking
Russ Cox [Mon, 10 Dec 2012 23:08:07 +0000 (18:08 -0500)]
doc/go1.1.html: add warning about net.ResolveTCPAddr error checking

Suggested by Paul Borman.

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

12 years agobufio: minor fixes
Russ Cox [Mon, 10 Dec 2012 22:25:31 +0000 (17:25 -0500)]
bufio: minor fixes

* note end-of-line and EOF behavior for ReadLine
* diagnose broken Readers

Fixes #3825.
Fixes #4276.

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

12 years agopprof: fix https URLs and 'profiler in use' errors
Russ Cox [Mon, 10 Dec 2012 22:06:30 +0000 (17:06 -0500)]
pprof: fix https URLs and 'profiler in use' errors

Fixes #3666.
Fixes #3680.

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

12 years agomime/multipart: allow setting the Writer boundary
Brad Fitzpatrick [Mon, 10 Dec 2012 21:30:42 +0000 (16:30 -0500)]
mime/multipart: allow setting the Writer boundary

Fixes #4490

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

12 years agospec: consistently use "indices" (rather than "indexes")
Robert Griesemer [Mon, 10 Dec 2012 19:55:57 +0000 (11:55 -0800)]
spec: consistently use "indices" (rather than "indexes")

We have been using all three terms "indices", "indexes",
and "index expressions" indiscriminatly for index values.
With this change, "index" refers to an index value,
"indices" is the plural of "index", and "index expression"
refers to an array, slice, or map indexed by an index: a[x].

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

12 years agoCONTRIBUTORS: add sledbetter (Google Corporate CLA).
Adam Langley [Mon, 10 Dec 2012 17:38:20 +0000 (12:38 -0500)]
CONTRIBUTORS: add sledbetter (Google Corporate CLA).

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

12 years agosyscall: add type for struct tcp_info
Brad Fitzpatrick [Mon, 10 Dec 2012 16:32:07 +0000 (11:32 -0500)]
syscall: add type for struct tcp_info

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

12 years agoencoding/xml: fix typo in Marshal documentation
Francisco Souza [Mon, 10 Dec 2012 15:59:15 +0000 (10:59 -0500)]
encoding/xml: fix typo in Marshal documentation

Fixes #4512.

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