kolo / xmlrpc

Implementation of XMLRPC protocol in Go language.
MIT License
159 stars 94 forks source link

Marshal/Unmarshal string to struct (and vice-versa) #68

Open smoyer64 opened 4 years ago

smoyer64 commented 4 years ago

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.

icholy commented 4 years ago

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
}