improve code Introduce according to grouping

This commit is contained in:
houseme
2021-11-16 19:43:02 +08:00
parent e86ee052cb
commit bb4f72d1ec
8 changed files with 26 additions and 20 deletions

View File

@ -11,6 +11,7 @@ import (
"bytes"
"github.com/BurntSushi/toml"
"github.com/gogf/gf/v2/internal/json"
)

View File

@ -11,6 +11,7 @@ import (
"strings"
"github.com/clbanning/mxj/v2"
"github.com/gogf/gf/v2/encoding/gcharset"
"github.com/gogf/gf/v2/text/gregex"
)
@ -63,9 +64,8 @@ func ToJson(content []byte) ([]byte, error) {
mv, err := mxj.NewMapXml(res)
if err == nil {
return mv.Json()
} else {
return nil, err
}
return nil, err
}
// convert does convert the encoding of given XML content from XML root tag into UTF-8 encoding content.