优化json解析

This commit is contained in:
2022-07-04 11:26:43 +08:00
parent 54ad5d7873
commit eb2302301f
2 changed files with 2 additions and 6 deletions

View File

@ -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数据