Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7)

Issue 5985059: code review 5985059: time: panic if UnixNano is out of range (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 11 months ago by niemeyer
Modified:
12 years, 11 months ago
Reviewers:
cw
CC:
golang-dev, remyoudompheng, dsymonds, gustavo_niemeyer.net, dchest, r, rsc
Visibility:
Public.

Description

time: panic if UnixNano is out of range

Patch Set 1 #

Patch Set 2 : code review 5985059: time: panic if UnixNano is out of range #

Patch Set 3 : diff -r 734071724054 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 734071724054 https://go.googlecode.com/hg/ #

Total comments: 2

Patch Set 5 : diff -r 734071724054 https://go.googlecode.com/hg/ #

Total comments: 3

Patch Set 6 : diff -r 734071724054 https://go.googlecode.com/hg/ #

Patch Set 7 : diff -r 734071724054 https://go.googlecode.com/hg/ #

Patch Set 8 : diff -r 734071724054 https://go.googlecode.com/hg/ #

Patch Set 9 : diff -r 734071724054 https://go.googlecode.com/hg/ #

Patch Set 10 : diff -r 734071724054 https://go.googlecode.com/hg/ #

Patch Set 11 : diff -r 734071724054 https://go.googlecode.com/hg/ #

Patch Set 12 : diff -r 734071724054 https://go.googlecode.com/hg/ #

Patch Set 13 : diff -r 734071724054 https://go.googlecode.com/hg/ #

Patch Set 14 : diff -r 734071724054 https://go.googlecode.com/hg/ #

Total comments: 2

Patch Set 15 : diff -r 734071724054 https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 16 : diff -r 344d5c33331a https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -1 line) Patch
M src/pkg/time/time.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 31
niemeyer
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 11 months ago (2012-04-07 17:52:03 UTC) #1
remyoudompheng
http://codereview.appspot.com/5985059/diff/4/src/pkg/time/time.go File src/pkg/time/time.go (right): http://codereview.appspot.com/5985059/diff/4/src/pkg/time/time.go#newcode775 src/pkg/time/time.go:775: if t.sec > maxUnixNano || t.sec < minUnixNano { ...
12 years, 11 months ago (2012-04-07 18:30:23 UTC) #2
niemeyer
Hello golang-dev@googlegroups.com, remyoudompheng@gmail.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 11 months ago (2012-04-07 18:31:59 UTC) #3
niemeyer
http://codereview.appspot.com/5985059/diff/4/src/pkg/time/time.go File src/pkg/time/time.go (right): http://codereview.appspot.com/5985059/diff/4/src/pkg/time/time.go#newcode775 src/pkg/time/time.go:775: if t.sec > maxUnixNano || t.sec < minUnixNano { ...
12 years, 11 months ago (2012-04-07 18:33:29 UTC) #4
dsymonds
Ouch. This seems a bit harsh. Why not just let it overflow? Even besides whether ...
12 years, 11 months ago (2012-04-07 23:20:49 UTC) #5
gustavo_niemeyer.net
On Sat, Apr 7, 2012 at 20:20, David Symonds <dsymonds@golang.org> wrote: > Ouch. This seems ...
12 years, 11 months ago (2012-04-07 23:34:32 UTC) #6
dsymonds
On Sun, Apr 8, 2012 at 9:34 AM, Gustavo Niemeyer <gustavo@niemeyer.net> wrote: >> Even besides ...
12 years, 11 months ago (2012-04-07 23:39:11 UTC) #7
gustavo_niemeyer.net
On Sat, Apr 7, 2012 at 20:39, David Symonds <dsymonds@golang.org> wrote: > On Sun, Apr ...
12 years, 11 months ago (2012-04-08 00:05:03 UTC) #8
dchest
On 2012/04/08 00:05:03, gustavo_niemeyer.net wrote: > Silently allowing that kind of garbage to go through ...
12 years, 11 months ago (2012-04-08 20:42:39 UTC) #9
gustavo_niemeyer.net
On Sun, Apr 8, 2012 at 17:42, <dchest@gmail.com> wrote: > time.Unix() is documented to allow ...
12 years, 11 months ago (2012-04-08 21:55:48 UTC) #10
dchest
On 2012/04/08 21:55:48, gustavo_niemeyer.net wrote: > On Sun, Apr 8, 2012 at 17:42, <mailto:dchest@gmail.com> wrote: ...
12 years, 11 months ago (2012-04-08 23:55:55 UTC) #11
r
http://codereview.appspot.com/5985059/diff/5/src/pkg/time/time.go File src/pkg/time/time.go (right): http://codereview.appspot.com/5985059/diff/5/src/pkg/time/time.go#newcode775 src/pkg/time/time.go:775: if t.sec > maxUnixNano || t.sec < minUnixNano { ...
12 years, 11 months ago (2012-04-09 06:00:28 UTC) #12
niemeyer
PTAL http://codereview.appspot.com/5985059/diff/5/src/pkg/time/time.go File src/pkg/time/time.go (right): http://codereview.appspot.com/5985059/diff/5/src/pkg/time/time.go#newcode775 src/pkg/time/time.go:775: if t.sec > maxUnixNano || t.sec < minUnixNano ...
12 years, 11 months ago (2012-04-09 14:32:45 UTC) #13
niemeyer
http://codereview.appspot.com/5985059/diff/5/src/pkg/time/time.go File src/pkg/time/time.go (right): http://codereview.appspot.com/5985059/diff/5/src/pkg/time/time.go#newcode775 src/pkg/time/time.go:775: if t.sec > maxUnixNano || t.sec < minUnixNano { ...
12 years, 11 months ago (2012-04-09 14:44:11 UTC) #14
rsc
I am not sure that I'm comfortable with something this low-level panicking. I think I ...
12 years, 11 months ago (2012-04-09 18:00:42 UTC) #15
gustavo_niemeyer.net
On Mon, Apr 9, 2012 at 15:00, Russ Cox <rsc@golang.org> wrote: > I am not ...
12 years, 11 months ago (2012-04-09 18:16:19 UTC) #16
gustavo_niemeyer.net
On Mon, Apr 9, 2012 at 15:15, Gustavo Niemeyer <gustavo@niemeyer.net> wrote: > You're right.. the ...
12 years, 11 months ago (2012-04-09 19:12:41 UTC) #17
remyoudompheng
Le 9 avril 2012 21:12, Gustavo Niemeyer <gustavo@niemeyer.net> a écrit : > On Mon, Apr ...
12 years, 11 months ago (2012-04-09 19:25:53 UTC) #18
gustavo_niemeyer.net
On Mon, Apr 9, 2012 at 16:25, Rémy Oudompheng <remyoudompheng@gmail.com> wrote: > t, _ := ...
12 years, 11 months ago (2012-04-09 19:43:52 UTC) #19
niemeyer
Hello golang-dev@googlegroups.com, remyoudompheng@gmail.com, dsymonds@golang.org, gustavo@niemeyer.net, dchest@gmail.com, r@golang.org, rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 11 months ago (2012-04-09 21:12:50 UTC) #20
gustavo_niemeyer.net
On Mon, Apr 9, 2012 at 18:12, <n13m3y3r@gmail.com> wrote: > Please take another look. > ...
12 years, 11 months ago (2012-04-09 21:16:49 UTC) #21
r
http://codereview.appspot.com/5985059/diff/5010/src/pkg/time/time.go File src/pkg/time/time.go (right): http://codereview.appspot.com/5985059/diff/5010/src/pkg/time/time.go#newcode785 src/pkg/time/time.go:785: } I suggest either clamping the value or maybe ...
12 years, 11 months ago (2012-04-09 21:19:06 UTC) #22
niemeyer
http://codereview.appspot.com/5985059/diff/5010/src/pkg/time/time.go File src/pkg/time/time.go (right): http://codereview.appspot.com/5985059/diff/5010/src/pkg/time/time.go#newcode785 src/pkg/time/time.go:785: } On 2012/04/09 21:19:06, r wrote: > I suggest ...
12 years, 11 months ago (2012-04-09 21:36:04 UTC) #23
rsc
I am unconvinced that is worth worrying about. I would document that if the result ...
12 years, 11 months ago (2012-04-09 21:44:13 UTC) #24
gustavo_niemeyer.net
On Mon, Apr 9, 2012 at 18:44, Russ Cox <rsc@golang.org> wrote: > I am unconvinced ...
12 years, 11 months ago (2012-04-09 22:16:23 UTC) #25
rsc
On Mon, Apr 9, 2012 at 18:15, Gustavo Niemeyer <gustavo@niemeyer.net> wrote: > On Mon, Apr ...
12 years, 11 months ago (2012-04-09 22:21:40 UTC) #26
gustavo_niemeyer.net
On Mon, Apr 9, 2012 at 19:21, Russ Cox <rsc@golang.org> wrote: > I don't understand. ...
12 years, 11 months ago (2012-04-09 23:49:40 UTC) #27
rsc
LGTM http://codereview.appspot.com/5985059/diff/2014/src/pkg/time/time.go File src/pkg/time/time.go (right): http://codereview.appspot.com/5985059/diff/2014/src/pkg/time/time.go#newcode766 src/pkg/time/time.go:766: // since January 1, 1970 UTC. The result ...
12 years, 11 months ago (2012-04-10 18:39:42 UTC) #28
niemeyer
*** Submitted as http://code.google.com/p/go/source/detail?r=4ed98a6b6fe5 *** time: panic if UnixNano is out of range R=golang-dev, remyoudompheng, ...
12 years, 11 months ago (2012-04-13 01:16:54 UTC) #29
niemeyer
On 2012/04/13 01:16:54, niemeyer wrote: > *** Submitted as http://code.google.com/p/go/source/detail?r=4ed98a6b6fe5 *** > > time: panic ...
12 years, 11 months ago (2012-04-13 01:25:42 UTC) #30
cw
12 years, 11 months ago (2012-04-13 03:58:50 UTC) #31
> For the record, this is wrong. It was a documentation change only.

phew

doc change, a+

adding panic ... i would prefer we did less of that on core pkgs
(passing stupid data in most cases deserves stupid results, but
ideally don't panic)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b