Skip to content

encoding/xml: attr does not work with pointer receiver. #4668

Closed
@nkatsaros

Description

@nkatsaros
See http://play.golang.org/p/OeSXsazIDS

If you unmarshal <Param2 int="1" />

into

type Param2 struct {
    Int *int `xml:"int,attr"`
}

Int will always be nil. As seen in the example, this works if Int is an element and not
an attribute.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions