You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gomongo/xml.go

17 lines
346 B

2 years ago
package gomongo
2 years ago
import (
"encoding/json"
"github.com/basgys/goxml2json"
"strings"
)
// XmlDecodeNoError Xml解码不报错
func XmlDecodeNoError(b []byte) map[string]interface{} {
xtj := strings.NewReader(string(b))
jtx, _ := xml2json.Convert(xtj)
var data map[string]interface{}
_ = json.Unmarshal(jtx.Bytes(), &data)
return data
}