Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/xml: rejection of *string field used as attribute #3719

Closed
anacrolix opened this issue Jun 10, 2012 · 6 comments
Closed

encoding/xml: rejection of *string field used as attribute #3719

anacrolix opened this issue Jun 10, 2012 · 6 comments
Milestone

Comments

@anacrolix
Copy link
Contributor

I'm marshalling this type:

585 type Resource struct {
586     XMLName      xml.Name `xml:"res"`
587     ProtocolInfo string   `xml:"protocolInfo,attr"`
588     URL          string   `xml:",chardata"`
589     Size         uint64   `xml:"size,attr"`
590     Bitrate      uint     `xml:"bitrate,attr"`
591     Duration     *string   `xml:"duration,attr"`
592 }

Which returns an error on the Duration field:

xml: unsupported type: *string

I'm using the tip.

Marshal purports to support this:

"Marshal handles a pointer by marshalling the value it points at or, if the pointer
is nil, by writing nothing."
@rsc
Copy link
Contributor

rsc commented Jun 13, 2012

Comment 1:

Perhaps this has to do with the field being marked as an attribute.

Labels changed: added priority-soon, removed priority-triage.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Sep 12, 2012

Comment 2:

Labels changed: added go1.1.

@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 4:

Labels changed: added size-m.

@minux
Copy link
Member

minux commented Jan 17, 2013

Comment 5:

Issue #4668 has been merged into this issue.

@kisielk
Copy link
Contributor

kisielk commented Jan 17, 2013

Comment 6:

Submitted https://golang.org/cl/7131052 for review.

@rsc
Copy link
Contributor

rsc commented Jan 18, 2013

Comment 7:

This issue was closed by revision 4730a22.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants