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

Comments

Projects
None yet
5 participants
@anacrolix
Copy link
Contributor

anacrolix commented Jun 10, 2012

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

rsc commented Sep 12, 2012

Comment 2:

Labels changed: added go1.1.

@rsc

This comment has been minimized.

Copy link
Contributor

rsc commented Dec 10, 2012

Comment 4:

Labels changed: added size-m.

@minux

This comment has been minimized.

Copy link
Member

minux commented Jan 17, 2013

Comment 5:

Issue #4668 has been merged into this issue.

@kisielk

This comment has been minimized.

Copy link
Contributor

kisielk commented Jan 17, 2013

Comment 6:

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

This comment has been minimized.

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.
You can’t perform that action at this time.