xmlrpc
xmlrpc copied to clipboard
Marshal/Unmarshal string to struct (and vice-versa)
String values should marshal/unmarshal to struct when MarshalText
/UnmarshalText
are implemented. both the encoding/json
and encoding/xml
packages provide this capability so it should be a matter of letting the underlying library do the encoding/decoding.
Can you provide a concrete example of what that would look like? Would MarshalText
return the entire value?
func (t Thing) MarshalText() ([]byte, error) {
return []byte("<value><int>1</int></value>"), nil
}