2015-09-08 17:55
浏览 379


I'm trying to convert json string in to xml format using Golang. My whole object is to convert json in to map string interface and then convert interface in to xml file. (There is no predefined structs). Please help me to solve this issue?

var f interface{}
err := json.Unmarshal(b, &f)
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doucu9677 2015-09-08 18:04

    There's an xml package that is equivalent to the json one under encoding. Just import it and then marshal the result of your json.Unmarshal

    import "encoding/xml"
    解决 无用
    打赏 举报

相关推荐 更多相似问题