增加JSON结果的解析

This commit is contained in:
白茶清欢 2022-06-30 21:51:49 +08:00
parent 67651bbe90
commit 696d31b0f2

View File

@ -8,6 +8,8 @@
package rpc
import (
"bytes"
"encoding/json"
"errors"
"github.com/tidwall/gjson"
"strings"
@ -58,7 +60,9 @@ type result struct {
//
// Date : 18:34 2022/6/30
func (r *result) ParseJSON(inputContent []byte, receiver interface{}) error {
return nil
decoder := json.NewDecoder(bytes.NewReader(inputContent))
decoder.UseNumber()
return decoder.Decode(receiver)
}
// ParseYaml 解析yaml数据