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

Issue 86960045: code review 86960045: encoding/asn1: only omit optional elements matching def... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by agl1
Modified:
10 years, 9 months ago
Reviewers:
bradfitz
CC:
golang-codereviews, bradfitz, rsc, r
Visibility:
Public.

Description

encoding/asn1: only omit optional elements matching default value. ASN.1 elements can be optional, and can have a default value. Traditionally, Go has omitted elements that are optional and that have the zero value. I believe that's a bug (see [1]). This change causes an optional element with a default value to only be omitted when it has that default value. The previous behaviour of omitting optional, zero elements with no default is retained because it's used quite a lot and will break things if changed. [1] https://groups.google.com/d/msg/Golang-nuts/9Ss6o9CW-Yo/KL_V7hFlyOAJ Fixes issue 7780. R=bradfitz

Patch Set 1 #

Patch Set 2 : diff -r 7021258fb723 https://code.google.com/p/go #

Patch Set 3 : diff -r 7021258fb723 https://code.google.com/p/go #

Total comments: 2

Patch Set 4 : diff -r cf71e2f3f8b5 https://code.google.com/p/go #

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

Patch Set 6 : diff -r f0b241ebf35c https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -6 lines) Patch
M src/pkg/encoding/asn1/asn1.go View 2 chunks +14 lines, -4 lines 0 comments Download
M src/pkg/encoding/asn1/marshal.go View 1 chunk +16 lines, -2 lines 0 comments Download
M src/pkg/encoding/asn1/marshal_test.go View 2 chunks +7 lines, -0 lines 0 comments Download

Messages

Total messages: 9
agl1
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
11 years, 1 month ago (2014-04-14 19:00:02 UTC) #1
bradfitz
LGTM but wait for rsc and r since this is late in Go 1.3. https://codereview.appspot.com/86960045/diff/40001/src/pkg/encoding/asn1/asn1.go ...
11 years, 1 month ago (2014-04-14 19:56:12 UTC) #2
rsc
If you (agl) are sure the new behavior is the right behavior, then it's fine ...
11 years, 1 month ago (2014-04-14 20:00:51 UTC) #3
agl1
On Mon, Apr 14, 2014 at 1:00 PM, Russ Cox <rsc@golang.org> wrote: > If you ...
11 years, 1 month ago (2014-04-16 18:11:25 UTC) #4
rsc
Let's leave it for 1.4 then, and there will only be one API change.
11 years, 1 month ago (2014-04-16 18:13:32 UTC) #5
rsc
R=close Feel free to pick up after 1.3; just removing from 1.3 dashboard.
11 years, 1 month ago (2014-04-17 02:41:32 UTC) #6
agl1
R=bradfitz Opening this back up because it's Go 1.4 now. I originally said that I'd ...
10 years, 10 months ago (2014-07-24 22:50:28 UTC) #7
bradfitz
LGTM Be sure to do a follow-up CL adding a note to go1.4.txt (modifying that ...
10 years, 10 months ago (2014-07-25 18:01:51 UTC) #8
agl1
10 years, 9 months ago (2014-07-28 21:47:44 UTC) #9
*** Submitted as https://code.google.com/p/go/source/detail?r=4218b3544610 ***

encoding/asn1: only omit optional elements matching default value.

ASN.1 elements can be optional, and can have a default value.
Traditionally, Go has omitted elements that are optional and that have
the zero value. I believe that's a bug (see [1]).

This change causes an optional element with a default value to only be
omitted when it has that default value. The previous behaviour of
omitting optional, zero elements with no default is retained because
it's used quite a lot and will break things if changed.

[1] https://groups.google.com/d/msg/Golang-nuts/9Ss6o9CW-Yo/KL_V7hFlyOAJ

Fixes issue 7780.

R=bradfitz

LGTM=bradfitz
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews, r
https://codereview.appspot.com/86960045
Sign in to reply to this message.

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