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

Issue 5634051: code review 5634051: time: clean up MarshalJSON, add RFC3339 method (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 2 months ago by rsc
Modified:
12 years, 2 months ago
Reviewers:
CC:
golang-dev, r, r2, niemeyer
Visibility:
Public.

Description

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 issue 2793.

Patch Set 1 #

Patch Set 2 : diff -r 82bac8cdab6b https://go.googlecode.com/hg/ #

Total comments: 2

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

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

Total comments: 1

Patch Set 5 : diff -r c111d33ea407 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+154 lines, -82 lines) Patch
M src/pkg/encoding/xml/atom_test.go View 1 3 chunks +9 lines, -4 lines 0 comments Download
M src/pkg/encoding/xml/marshal.go View 1 2 3 4 3 chunks +12 lines, -0 lines 0 comments Download
M src/pkg/encoding/xml/marshal_test.go View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M src/pkg/encoding/xml/read.go View 1 3 chunks +13 lines, -0 lines 0 comments Download
M src/pkg/encoding/xml/read_test.go View 1 2 7 chunks +18 lines, -19 lines 0 comments Download
M src/pkg/time/format.go View 1 2 3 4 7 chunks +54 lines, -23 lines 0 comments Download
M src/pkg/time/time.go View 1 2 1 chunk +3 lines, -32 lines 0 comments Download
M src/pkg/time/time_test.go View 1 2 3 5 chunks +38 lines, -4 lines 0 comments Download

Messages

Total messages: 9
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 2 months ago (2012-02-06 21:54:40 UTC) #1
rsc
(Fixes issue 2793)
12 years, 2 months ago (2012-02-06 21:55:04 UTC) #2
r
http://codereview.appspot.com/5634051/diff/2001/src/pkg/time/time.go File src/pkg/time/time.go (right): http://codereview.appspot.com/5634051/diff/2001/src/pkg/time/time.go#newcode843 src/pkg/time/time.go:843: // Trailing zeros are trimmed from the fraction in ...
12 years, 2 months ago (2012-02-07 00:10:59 UTC) #3
rsc
On Mon, Feb 6, 2012 at 19:10, <r@golang.org> wrote: > i'm unclear why this format ...
12 years, 2 months ago (2012-02-07 01:43:28 UTC) #4
r2
On Feb 7, 2012, at 12:43 PM, Russ Cox wrote: > On Mon, Feb 6, ...
12 years, 2 months ago (2012-02-07 02:17:14 UTC) #5
rsc
Hello golang-dev@googlegroups.com, r@golang.org, r@google.com (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 2 months ago (2012-02-07 22:01:58 UTC) #6
niemeyer
LGTM Makes me wonder how we can enable the developer to tweak the format so ...
12 years, 2 months ago (2012-02-08 00:12:24 UTC) #7
r
LGTM that turned out well http://codereview.appspot.com/5634051/diff/9009/src/pkg/time/format.go File src/pkg/time/format.go (right): http://codereview.appspot.com/5634051/diff/9009/src/pkg/time/format.go#newcode172 src/pkg/time/format.go:172: case '.': // .000 ...
12 years, 2 months ago (2012-02-08 00:18:44 UTC) #8
rsc
12 years, 2 months ago (2012-02-08 04:37:28 UTC) #9
*** Submitted as a4dc8322859a ***

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 issue 2793.

R=golang-dev, r, r, n13m3y3r
CC=golang-dev
http://codereview.appspot.com/5634051
Sign in to reply to this message.

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