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 #5334

Closed
gopherbot opened this issue Apr 23, 2013 · 7 comments
Closed

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

gopherbot opened this issue Apr 23, 2013 · 7 comments
Milestone

Comments

@gopherbot
Copy link

by deemok:

The following struct does not marshal:
type foo struct {
    Name *string `xml:"name,attr"`
}
Giving 'xml: unsupported type: *string'

It does not work both on playground and on tip

Although, there's https://golang.org/issue/3719 which describes the
same issue, the fix surprisingly only implements the unmarshaling part.
@gopherbot
Copy link
Author

Comment 1 by deemok:

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

@gopherbot
Copy link
Author

Comment 2 by deemok:

Sorry, the patch is no good - I made a typo and the test would have failed. 
Will submit a new patch when it's ready!

@gopherbot
Copy link
Author

Comment 3 by deemok:

Also, the following does not marshal albeit silently (w/o giving an error and w/o
producing the output for the chardata field):
type foo struct {
    XMLName xml.Name `xml:"foo"`
    Text *string `xml:",chardata"`
}

@davecheney
Copy link
Contributor

Comment 4:

https://golang.org/cl/8653047

Status changed to Started.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 5:

Labels changed: added priority-later, go1.2maybe, removed priority-triage.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 6:

Labels changed: added feature.

@bradfitz
Copy link
Contributor

bradfitz commented Aug 8, 2013

Comment 7:

This issue was closed by revision 547f1a6.

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2maybe 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

4 participants