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

Issue 13553050: encoding/json: make omitempty honor IsZero() methods

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 7 months ago by pdp
Modified:
10 years, 7 months ago
Reviewers:
Visibility:
Public.

Description

encoding/json: make omitempty honor IsZero() methods Packages such as time have IsZero() methods, to detect an empty time. By default, encoding/json will still encode the zero value into the bytes. This change has a proposed fix, with tests, for JSON only. If the approach is deemed suitable, then similar fixes will be needed for the other marshalling formats. Affects issue 4357.

Patch Set 1 #

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -2 lines) Patch
M src/pkg/encoding/json/encode.go View 1 3 chunks +25 lines, -2 lines 0 comments Download
M src/pkg/encoding/json/encode_test.go View 1 1 chunk +53 lines, -0 lines 0 comments Download

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