优化json解析
This commit is contained in:
@ -9,11 +9,11 @@ package rpc
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"git.zhangdeman.cn/zhangdeman/util"
|
||||
"github.com/tidwall/gjson"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
@ -64,9 +64,7 @@ type result struct {
|
||||
//
|
||||
// Date : 18:34 2022/6/30
|
||||
func (r *result) ParseJSON(inputContent []byte, receiver interface{}) error {
|
||||
decoder := json.NewDecoder(bytes.NewReader(inputContent))
|
||||
decoder.UseNumber()
|
||||
return decoder.Decode(receiver)
|
||||
return util.JSON.UnmarshalWithNumber(inputContent, receiver)
|
||||
}
|
||||
|
||||
// ParseYaml 解析yaml数据
|
||||
|
Reference in New Issue
Block a user