go/src/pkg/time
Russ Cox dcc46388df time: accept .999 in Parse
The recent shuffle in parsing formats exposed probably unintentional
behavior in time.Parse, namely that it was mostly ignoring ".99999"
in the format, producing the following behavior:

fmt.Println(time.Parse("03:04:05.999 MST", "12:00:00.888 PDT")) // error (.888 unexpected)
fmt.Println(time.Parse("03:04:05.999", "12:00:00")) // error (input too short)
fmt.Println(time.Parse("03:04:05.999 MST", "12:00:00 PDT"))  // ok (extra bytes on input make it ok)

http://play.golang.org/p/ESJ1UYXzq2

API CHANGE:

This CL makes all three examples valid: ".999" can match an
empty string or else a fractional second with at most nine digits.

Fixes #3701.

R=r, r
CC=golang-dev
https://golang.org/cl/6267045
2012-06-04 13:09:19 -04:00
..
example_test.go godoc: make example code more readable with new comment convention 2012-02-16 11:50:28 +11:00
format.go time: accept .999 in Parse 2012-06-04 13:09:19 -04:00
internal_test.go time: fix daysIn for December 2011-12-07 14:47:25 -05:00
sleep.go time: fix godoc for After and NewTicker. 2012-01-07 20:53:53 -05:00
sleep_test.go time: fix deadlock in Sleep(0) 2012-05-29 22:30:56 +04:00
sys_plan9.go os,time: fix Plan 9 build 2012-02-20 12:31:24 +11:00
sys_unix.go time: switch to using (uncompressed) zoneinfo zip file 2012-02-19 03:16:20 -05:00
sys_windows.go time: switch to using (uncompressed) zoneinfo zip file 2012-02-19 03:16:20 -05:00
tick.go time: fix godoc for After and NewTicker. 2012-01-07 20:53:53 -05:00
tick_test.go time: during short test, do not bother tickers take longer than expected 2012-03-07 01:10:55 +08:00
time.go time: make Format 2.7x faster 2012-06-03 11:08:17 -04:00
time_test.go time: accept .999 in Parse 2012-06-04 13:09:19 -04:00
zoneinfo.go time: make Format 2.7x faster 2012-06-03 11:08:17 -04:00
zoneinfo_plan9.go os,time: fix Plan 9 build 2012-02-20 12:31:24 +11:00
zoneinfo_read.go time: switch to using (uncompressed) zoneinfo zip file 2012-02-19 03:16:20 -05:00
zoneinfo_unix.go time: switch to using (uncompressed) zoneinfo zip file 2012-02-19 03:16:20 -05:00
zoneinfo_windows.go time: fix handling of locations with no dst on windows 2012-04-03 11:39:38 +10:00