1
0
mirror of https://github.com/golang/go synced 2024-10-04 13:21:22 -06:00
Commit Graph

16944 Commits

Author SHA1 Message Date
Ulf Holm Nielsen
aa38aeaeaf time: Allow Parse and Format to handle time zone offsets with seconds
Adds layout cases with seconds for stdISO8601 and stdNumTZ with and without colons. Update time.Format to append seconds for those cases.

Fixes #4934.

R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/8132044
2013-07-31 16:11:02 +10:00
Rob Pike
936cc5e7fa A+C: Ulf Holm Nielsen (individual CLA)
Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/12146043
2013-07-31 16:10:50 +10:00
Rob Pike
df4de948a5 text/template/parse: print TextNodes using %s not %q
This means that printing a Node will produce output that can be used as valid input.
It won't be exactly the same - some spacing may be different - but it will mean the same.

Fixes #4593.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/12006047
2013-07-31 15:09:13 +10:00
Rob Pike
221af5c12f fmt: treat \r\n as \n in Scan
When scanning input and "white space" is permitted, a carriage return
followed immediately by a newline (\r\n) is treated exactly the same
as a plain newline (\n). I hope this makes it work better on Windows.

We do it everywhere, not just on Windows, since why not?

Fixes #5391.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/12142043
2013-07-31 15:00:08 +10:00
Keith Randall
a696ae56db runtime: optimize some hash lookups.
When comparing strings, check these (in order):
- length mismatch => not equal
- string pointer equal => equal
- if length is short:
  - memeq on body
- if length is long:
  - compare first&last few bytes, if different => not equal
  - save entry as a possible match
  - after checking every entry, if there is only one possible
    match, use memeq on that entry.  Otherwise, fallback to hash.

benchmark                 old ns/op    new ns/op    delta
BenchmarkSameLengthMap           43            4  -89.77%

Fixes #5194.
Update #3885.

R=golang-dev, bradfitz, khr, rsc
CC=golang-dev
https://golang.org/cl/12128044
2013-07-30 21:39:57 -07:00
Rob Pike
609d742e79 fmt: remove "Scan:" prefix from error messages
The prefix was not uniformly applied and is probably better left off anyway.

Fixes #4944.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/12140043
2013-07-31 14:09:19 +10:00
Rob Pike
02ad82fe15 fmt: put a ! in all error output generated by Printf-like functions
Fixes #5730.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/12141043
2013-07-31 14:08:47 +10:00
Mikio Hara
fa673bd872 net: add simple SetKeepAlivePeriod call test
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/12090043
2013-07-31 12:34:14 +09:00
Russ Cox
1794880299 runtime: fix build on FreeBSD
This is what I get for being talked into a test.

TBR=bradfitz
CC=golang-dev
https://golang.org/cl/12045044
2013-07-30 23:21:07 -04:00
Rob Pike
5fea8c030b text/template: fix type of ComplexZero in test
Was stupidly float64; should be complex128.
The tests still pass.

Fixes #5649.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12107044
2013-07-31 13:04:57 +10:00
Russ Cox
6a13897bc6 runtime: ARM _sfloat has no arguments
Fixes one build failure.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/12139043
2013-07-30 22:58:38 -04:00
Russ Cox
57933b86b1 cmd/go: send timed out test SIGQUIT before SIGKILL
There is a chance that the SIGQUIT will make the test process
dump its stacks as part of exiting, which would be nice for
finding out what it is doing.

Right now the builders are occasionally timing out running
the runtime test. I hope this will give us some information
about the state of the runtime.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/12041051
2013-07-30 22:52:10 -04:00
Russ Cox
4042b77776 runtime: cut struct Hmap back to 48-byte allocation
struct Hmap is the header for a map value.

CL 8377046 made flags a uint32 so that it could be updated atomically,
but that bumped the struct to 56 bytes, which allocates as 64 bytes (on amd64).

hash0 is initialized from runtime.fastrand1, which returns a uint32,
so the top 32 bits were always zero anyway. Declare it as a uint32
to reclaim 4 bytes and bring the Hmap size back down to a 48-byte allocation.

Fixes #5237.

R=golang-dev, khr, khr
CC=bradfitz, dvyukov, golang-dev
https://golang.org/cl/12034047
2013-07-30 22:48:03 -04:00
Shivakumar GN
3abaf5cae0 net/http: skip TestDirJoin on Windows, even if /etc/hosts exists
Fixes #5460.

R=golang-dev, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/12123043
2013-07-30 18:25:08 -07:00
Robert Griesemer
12a38d5b95 container/list: document complexity of Len
Fixes #5972.

R=golang-dev, adonovan
CC=golang-dev
https://golang.org/cl/12125043
2013-07-30 13:35:14 -07:00
Dmitriy Vyukov
3d6bce411c runtime: fix code formatting
This is mainly to force another build
with goroutine preemption.

R=rsc
CC=golang-dev
https://golang.org/cl/12006045
2013-07-30 23:48:18 +04:00
Dmitriy Vyukov
a20784bdaf runtime: enable goroutine preemption
All known issues with preemption have beed fixed.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12008044
2013-07-30 22:17:38 +04:00
Dmitriy Vyukov
5c8ad2e13d runtime: fix race builders
Do not run Syscall benchmarks under race detector,
they split stack in syscall status.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12093045
2013-07-30 22:13:51 +04:00
Dmitriy Vyukov
3b6de5e847 net: fix memory leak on unix
If netFD is closed by finalizer, runtime netpoll descriptor is not freed.

R=golang-dev, dave, alex.brainman
CC=golang-dev
https://golang.org/cl/12037043
2013-07-30 19:47:16 +04:00
Russ Cox
cd2eb48722 cmd/gc: don't report mark if other things are broken
Fixes #5598.

R=ken2
CC=golang-dev
https://golang.org/cl/12104043
2013-07-30 10:27:26 -04:00
Russ Cox
27d17255db cmd/gc: insert \n at end of every input file
Not just the first one.

Fixes #5433.
Fixes #5913.

R=ken2
CC=golang-dev
https://golang.org/cl/12028049
2013-07-30 10:27:08 -04:00
Mikio Hara
28138f1364 net: fix comment on SetKeepAlivePeriod
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/12091043
2013-07-30 16:31:57 +09:00
Mikio Hara
8f32df5455 net: add missing SetKeepAlivePeriod for Plan 9
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/12082045
2013-07-30 16:29:51 +09:00
Andrew Gerrand
d920d8d849 doc: don't block page load on JavaScript fetch
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/12050045
2013-07-30 14:22:14 +10:00
Alex A Skinner
789e1c351e encoding/xml: Do not pass through invalid utf8 bytes
EscapeText now escapes 0xFFFD returned from DecodeRune as 0xFFFD, rather than passing through the original byte.
Fixes #5880.

R=golang-dev, r, bradfitz, adg
CC=golang-dev
https://golang.org/cl/11975043
2013-07-30 14:11:47 +10:00
Andrew Gerrand
51b3611a72 A+C: Alex A Skinner (individual CLA)
Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/12084043
2013-07-30 14:10:50 +10:00
Rémy Oudompheng
4eaf91a7a7 cmd/gc: make bisonerrors compatible with GNU Bison 3.0
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/11990043
2013-07-30 04:31:15 +02:00
Andrew Gerrand
fc32bfa9cc doc/codewalk: test source code
Fixes #2648.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/11331043
2013-07-30 09:42:53 +10:00
Robert Griesemer
3eb9adeeb8 go/parser: don't report name errors if DeclarationErrors is not set
R=adonovan
CC=golang-dev
https://golang.org/cl/12072043
2013-07-29 16:00:28 -07:00
Russ Cox
fdb69cb0a3 build: fix build
As promised.

TBR=dvyukov
CC=golang-dev
https://golang.org/cl/12063043
2013-07-29 16:52:40 -04:00
Robert Griesemer
340918a8a3 go/parser: selectors may be method expressions
R=adonovan
CC=golang-dev
https://golang.org/cl/12062043
2013-07-29 13:52:15 -07:00
Russ Cox
46437f0028 build: break builds
I want to see the timing information in build logs,
and we can't see the logs for "ok" builds.
So make the build fail everywhere.

Will roll back immediately.

TBR=dvyukov
CC=golang-dev
https://golang.org/cl/12058046
2013-07-29 16:52:03 -04:00
Russ Cox
c7d5c438a2 runtime: adjust timediv to avoid _vasop; mark _subv okay
R=dvyukov
CC=golang-dev
https://golang.org/cl/12028046
2013-07-29 16:42:07 -04:00
Russ Cox
98cc58e2c7 runtime: fix timediv calls on NetBSD, OpenBSD
Document endian-ness assumption.

R=dvyukov
CC=golang-dev
https://golang.org/cl/12056044
2013-07-29 16:31:42 -04:00
Dmitriy Vyukov
14e3540430 runtime: fix arm build
The current failure is:
fatal error: runtime: stack split during syscall
goroutine 2 [stack split]:
_si2v(0xb6ebaebc, 0x3b9aca00)
        /usr/local/go/src/pkg/runtime/vlrt_arm.c:628 fp=0xb6ebae9c
runtime.timediv(0xf8475800, 0xd, 0x3b9aca00, 0xb6ebaef4)
        /usr/local/go/src/pkg/runtime/runtime.c:424 +0x1c fp=0xb6ebaed4

Just adding textflag 7 causes the following error:
notetsleep: nosplit stack overflow
        128	assumed on entry to notetsleep
        96	after notetsleep uses 32
        60	after runtime.futexsleep uses 36
        4	after runtime.timediv uses 56
        -4	after _si2v uses 8

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12001045
2013-07-30 00:08:30 +04:00
Robert Griesemer
5bd61e0603 math/big: better documentation for Rat.Float64
R=adonovan, r
CC=golang-dev
https://golang.org/cl/11961043
2013-07-29 13:06:34 -07:00
Dmitriy Vyukov
64db2ec915 runtime: fix arm build
The current failure is:
fatal error: runtime: stack split during syscall
goroutine 2 [stack split]:
_addv(0xb6fa0f28, 0xd0a5112e, 0x13156d6e, 0xf8475800, 0xd)
        /usr/local/go/src/pkg/runtime/vlrt_arm.c:66 fp=0xb6fa0ef8
notetsleep(0xb6fa0f9c, 0xf8475800, 0xd, 0x0, 0x0, ...)
        /usr/local/go/src/pkg/runtime/lock_futex.c:156 +0xd0 fp=0xb6fa0f18
runtime.notetsleepg(0xb6fa0f9c, 0xf8475800, 0xd)
        /usr/local/go/src/pkg/runtime/lock_futex.c:197 +0x74 fp=0xb6fa0f3c

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12052043
2013-07-29 23:41:12 +04:00
Dmitriy Vyukov
d91219e458 runtime: fix linux/arm build
notetsleep: nosplit stack overflow
        128	assumed on entry to notetsleep
        80	after notetsleep uses 48
        44	after runtime.futexsleep uses 36
        -12	after runtime.timediv uses 56

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12049043
2013-07-29 22:59:30 +04:00
Dmitriy Vyukov
ddc01d5b06 runtime: fix openbsd build
notetsleep: nosplit stack overflow
        120	assumed on entry to notetsleep
        96	after notetsleep uses 24
        88	on entry to runtime.semasleep
        32	after runtime.semasleep uses 56
        24	on entry to runtime.nanotime
        -8	after runtime.nanotime uses 32

Nanotime seems to be using only 24 bytes of stack space.
Unless I am missing something.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12041044
2013-07-29 22:58:58 +04:00
Dmitriy Vyukov
d83688165a runtime: fix freebsd build
notetsleep: nosplit stack overflow
        120	assumed on entry to notetsleep
        80	after notetsleep uses 40
        72	on entry to runtime.futexsleep
        16	after runtime.futexsleep uses 56
        8	on entry to runtime.printf
        -16	after runtime.printf uses 24

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12047043
2013-07-29 22:58:26 +04:00
Dmitriy Vyukov
e84d9e1fb3 runtime: do not split stacks in syscall status
Split stack checks (morestack) corrupt g->sched,
but g->sched must be preserved consistent for GC/traceback.
The change implements runtime.notetsleepg function,
which does entersyscall/exitsyscall and is carefully arranged
to not call any split functions in between.

R=rsc
CC=golang-dev
https://golang.org/cl/11575044
2013-07-29 22:22:34 +04:00
Dmitriy Vyukov
b8734748b6 net: fix memory leaks on windows
Close netpoll descriptor along with socket.
Ensure that error paths close the descriptor as well.

R=golang-dev, mikioh.mikioh, alex.brainman
CC=golang-dev
https://golang.org/cl/11987043
2013-07-29 20:01:13 +04:00
Pieter Droogendijk
6350e45892 runtime: allow SetFinalizer with a func(interface{})
Fixes #5368.

R=golang-dev, dvyukov
CC=golang-dev, rsc
https://golang.org/cl/11858043
2013-07-29 19:43:08 +04:00
Mikio Hara
3398322d5e net: remove redundant comment on isWildcard
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/11985043
2013-07-29 23:26:11 +09:00
Mikio Hara
442e614cab net: document sockaddr interface
This is in preparation for runtime-integrated network pollster for BSD
variants.

Update #5199

R=golang-dev, fvbommel, dave
CC=golang-dev
https://golang.org/cl/11984043
2013-07-29 23:25:39 +09:00
Andrew Gerrand
f6dd45bf82 doc/articles: state that slices/arrays start at the 0th element
Fixes #5881.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/11892043
2013-07-29 18:33:39 +10:00
Alex Brainman
6db195cae2 misc/dashboard/builder: increase cmdTimeout to 10 minutes
It takes more then 5 minutes to clone go repo
on windows-386 builder now.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/12007043
2013-07-29 14:31:21 +10:00
David Symonds
e87af8c43d misc/dashboard: don't update tip tag for release branch commits.
This will mean that sub-repositories won't get built against the
release branch. They are often not compatible because the subrepos
often run ahead of the current release (e.g. go.tools is using
new additions to go/ast, and go.net is using new things in syscall)
so there's little point in checking them against cherrypick commits
when they'll be tested against those commits on tip anyway.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/12001043
2013-07-29 12:08:19 +10:00
Rémy Oudompheng
b7c3d06a1f all: move examples into package *_test.
Fixes #5677.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/11992043
2013-07-29 01:25:51 +02:00
Rémy Oudompheng
d26d5e6403 effective_go.html: make snippets look formatted.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/11991043
2013-07-29 00:57:19 +02:00