1
0
mirror of https://github.com/golang/go synced 2024-10-04 15:11:20 -06:00
Commit Graph

151 Commits

Author SHA1 Message Date
Robert Griesemer
7c6654aa70 all: fixed various typos
(Semi-automatically detected.)

R=golang-dev, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/5715052
2012-03-01 14:56:05 -08:00
Brad Fitzpatrick
8c5290502f time: skip a often-flaky test in short mode
In -test.short mode, skip measuring the upper bound of time
sleeps. The API only guarantees minimum bounds on sleeps,
anyway, so this isn't a bug we're ignoring as much as it is
simply observing bad builder virtualization and/or loaded
machines.

We keep the test in full mode where developers will
presumably be running on a lightly-loaded, native, fast
machine.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5713044
2012-02-29 13:14:05 -08:00
Rémy Oudompheng
c10f50859e all: remove various unused unexported functions and constants.
R=golang-dev, minux.ma, rsc
CC=golang-dev, remy
https://golang.org/cl/5702050
2012-02-28 21:48:03 +01:00
Rob Pike
d781603931 time: add a comment about how to use the Duration constants
R=golang-dev, bradfitz, r, dsymonds
CC=golang-dev
https://golang.org/cl/5696078
2012-02-26 22:24:51 +11:00
Alex Brainman
fea7f07e56 time: run full TestTicker test even during short tests
R=golang-dev, r, bradfitz, r
CC=golang-dev
https://golang.org/cl/5689076
2012-02-23 12:07:59 +11:00
Fazlul Shahriar
441538eb57 os,time: fix Plan 9 build
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5689043
2012-02-20 12:31:24 +11:00
Russ Cox
cb5e181fe7 time: switch to using (uncompressed) zoneinfo zip file
Removal of old zoneinfo files is a separate CL due to its size.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5676100
2012-02-19 03:16:20 -05:00
Russ Cox
ad17a9c0a9 time: use Go distribution zoneinfo if system copy not found
Fixes #2964.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5656101
2012-02-18 21:02:41 -05:00
Andrew Gerrand
11e113db57 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
2012-02-16 11:50:28 +11:00
Alex Brainman
9a44560033 time: run TestTicker for longer during short test, otherwise it fails
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5671049
2012-02-15 14:56:47 +11:00
Rémy Oudompheng
2a6e6999a4 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
2012-02-14 22:13:19 +01:00
Russ Cox
d599accafa 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
2012-02-14 11:17:48 -05:00
Rob Pike
1bfffb67d8 time: improve commentary about standard time and formatting/parsing
Fixes #2965.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5652054
2012-02-10 13:52:19 +11:00
Russ Cox
1d8250c8b0 time: clean up MarshalJSON, add RFC3339 method
encoding/xml: handle time.Time as recognized type

The long term plan is to define an interface that time.Time
can implement and that encoding/xml can call, but we are
not going to try to define that interface before Go 1.
Instead, special-case time.Time in package xml, because
it is such a fundamental type, as a stop-gap.
The eventual methods will behave this way.

Fixes #2793.

R=golang-dev, r, r, n13m3y3r
CC=golang-dev
https://golang.org/cl/5634051
2012-02-07 23:37:25 -05:00
Russ Cox
2050a9e478 build: remove Make.pkg, Make.tool
Consequently, remove many package Makefiles,
and shorten the few that remain.

gomake becomes 'go tool make'.

Turn off test phases of run.bash that do not work,
flagged with $BROKEN.  Future CLs will restore these,
but this seemed like a big enough CL already.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5601057
2012-01-30 23:43:46 -05:00
Olivier Duperray
e5c1f3870b pkg: Add & fix Copyright of "hand generated" files
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5554064
2012-01-19 10:14:56 -08:00
Sameer Ajmani
20812c4907 time: add Since, which returns the time elapsed since some past time t.
R=rsc, r
CC=golang-dev
https://golang.org/cl/5532088
2012-01-18 15:25:00 -05:00
Rob Pike
eaecf357e7 time: delete unused buffer.WriteByte method
R=golang-dev, bradfitz, r, rsc
CC=golang-dev
https://golang.org/cl/5539056
2012-01-13 11:47:55 -08:00
Sameer Ajmani
1379d90651 time: fix godoc for After and NewTicker.
R=golang-dev, gri, bradfitz, iant
CC=golang-dev, rsc
https://golang.org/cl/5523049
2012-01-07 20:53:53 -05:00
David Symonds
f298d0ce29 time: add ParseDuration.
R=rsc, r, r
CC=golang-dev
https://golang.org/cl/5489111
2011-12-23 16:28:56 +11:00
Joel Sing
9ca57a706c crypto/mime/net/time: add netbsd to +build tags
R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5501052
2011-12-21 21:44:47 +11:00
Robert Hencke
317ad14c6a time: JSON marshaler for Time
R=golang-dev, dsymonds, hectorchu, r, r
CC=golang-dev
https://golang.org/cl/5496064
2011-12-20 09:01:18 -08:00
Roger Peppe
cebf55dc9b time: new AddDate method
R=rsc
CC=golang-dev
https://golang.org/cl/5465044
2011-12-15 11:23:01 -05:00
Russ Cox
fc7b9fc269 time: allow sleep tests to run for 200% too long
Some VMs are slow.  Very slow.
Fixes #2421.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5482049
2011-12-12 18:33:47 -05:00
Anthony Martin
1cb254a085 time: fix Plan 9 build for new API
I had to move readFile into sys_$GOOS.go
since syscall.Open takes only two arguments
on Plan 9.

R=lucio.dere, rsc, alex.brainman
CC=golang-dev
https://golang.org/cl/5447061
2011-12-12 16:12:22 -05:00
Robert Hencke
d0cf3fa21e time: gob marshaler for Time
Addresses issue 2526

R=rsc, r
CC=golang-dev
https://golang.org/cl/5448114
2011-12-12 16:08:29 -05:00
Christopher Nielsen
728c16cf13 build: Changes to the build infrastructure for NetBSD.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5476048
2011-12-12 15:42:06 -05:00
Hector Chu
fdb09d289a time: fix Time.Add
R=rsc, r
CC=golang-dev
https://golang.org/cl/5448121
2011-12-10 21:55:38 +00:00
David Symonds
2949f3b659 time: use Duration for AfterFunc.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5465043
2011-12-08 15:42:44 +11:00
Peter Mundy
69191553e7 time: fix daysIn for December
daysBefore[12+1]: index out of range
time.December and Windows SYSTEMTIME.wMonth
are 12 for December.

R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/5448130
2011-12-07 14:47:25 -05:00
Russ Cox
2666b815a3 use new strconv API
All but 3 cases (in gcimporter.go and hixie.go)
are automatic conversions using gofix.

No attempt is made to use the new Append functions
even though there are definitely opportunities.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5447069
2011-12-05 15:48:46 -05:00
Rob Pike
473de60359 time: update doc string for Error method
Fixes #2512.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5449057
2011-12-01 11:44:17 -08:00
Alex Brainman
68e30a9765 time: fix windows build
R=rsc
CC=golang-dev
https://golang.org/cl/5440071
2011-12-01 15:26:28 +11:00
Russ Cox
97197a6248 time: fix windows build
TBR=brainman
CC=golang-dev
https://golang.org/cl/5447057
2011-11-30 15:45:24 -05:00
Russ Cox
8dce57e169 os: new FileInfo, FileMode types + update tree
R=golang-dev, r, r, gri, bradfitz, iant, iant, nigeltao, n13m3y3r
CC=golang-dev
https://golang.org/cl/5416060
2011-11-30 12:04:16 -05:00
Russ Cox
efe3d35fc5 time: new Time, Duration, ZoneInfo types
R=r, bradfitz, gri, dsymonds, iant
CC=golang-dev
https://golang.org/cl/5392041
2011-11-30 11:59:44 -05:00
Dmitriy Vyukov
a899a467f2 time: fix timer stop
Due to data structure corruption,
some timers could not be removed.
Fixes #2495.

R=golang-dev, adg
CC=golang-dev, mdbrown
https://golang.org/cl/5437060
2011-11-25 14:13:10 +03:00
Lucio De Re
087a34869a syscall, os, time: fix Plan 9 build
R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5371092
2011-11-16 17:37:54 -05:00
Dmitriy Vyukov
ba98a7ee5e time: fix test hang
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5374083
2011-11-14 22:31:39 +03:00
Dmitriy Vyukov
dc6726b37f runtime: fix timers crash
Timer callbacks occasionally crash
with "sched while holding locks" message.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5381043
2011-11-14 21:59:48 +03:00
Russ Cox
c017a8299f syscall: use error
- syscall (not os) now defines the Errno type.
- the low-level assembly functions Syscall, Syscall6, and so on
  return Errno, not uintptr
- syscall wrappers all return error, not uintptr.

R=golang-dev, mikioh.mikioh, r, alex.brainman
CC=golang-dev
https://golang.org/cl/5372080
2011-11-13 22:44:52 -05:00
Russ Cox
b126902e84 time: remove unused sysSleep
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5369094
2011-11-13 22:42:57 -05:00
Anthony Martin
a6c501e4b1 net, io/ioutil: remove use of os.Time
I had to replace the single use of io/ioutil
in the time package with a bytes.Buffer since
there would've been a dependency cycle.

There are no other uses of os.Time.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5372054
2011-11-11 14:40:41 -05:00
Volker Dobler
d989709630 time: add ISOWeek method to Time
As the ISO 8601 week number is untrivial to compute a new method
on *Time provides year and number of week.

R=golang-dev, rsc, r, r
CC=golang-dev
https://golang.org/cl/5316074
2011-11-10 12:40:50 -08:00
Russ Cox
3b860269ee runtime: add timer support, use for package time
This looks like it is just moving some code from
time to runtime (and translating it to C), but the
runtime can do a better job managing the goroutines,
and it needs this functionality for its own maintenance
(for example, for the garbage collector to hand back
unused memory to the OS on a time delay).
Might as well have just one copy of the timer logic,
and runtime can't depend on time, so vice versa.

It also unifies Sleep, NewTicker, and NewTimer behind
one mechanism, so that there are no claims that one
is more efficient than another.  (For example, today
people recommend using time.After instead of time.Sleep
to avoid blocking an OS thread.)

Fixes #1644.
Fixes #1731.
Fixes #2190.

R=golang-dev, r, hectorchu, iant, iant, jsing, alex.brainman, dvyukov
CC=golang-dev
https://golang.org/cl/5334051
2011-11-09 15:17:05 -05:00
Russ Cox
f437331f80 time: faster Nanoseconds call
runtime knows how to get the time of day
without allocating memory.

R=golang-dev, dsymonds, dave, hectorchu, r, cw
CC=golang-dev
https://golang.org/cl/5297078
2011-11-03 17:35:28 -04:00
Russ Cox
965845a86d all: sort imports
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5319072
2011-11-02 15:54:16 -04:00
Russ Cox
eb6929299b src/pkg/[n-z]*: gofix -r error -force=error
R=golang-dev, bsiegert, iant
CC=golang-dev
https://golang.org/cl/5294074
2011-11-01 22:05:34 -04:00
Scott Lawrence
a7e473be95 time: add RFC1123 with numeric timezone format
Fixes #841.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5322058
2011-10-31 12:59:06 -07:00
Paul Borman
93b8438e59 time: make month/day name comparisons case insenstive
Fixes #2324.

R=r, r
CC=golang-dev
https://golang.org/cl/5180044
2011-10-04 12:52:30 -07:00