增加JSON结果的解析
This commit is contained in:
parent
67651bbe90
commit
696d31b0f2
@ -8,6 +8,8 @@
|
|||||||
package rpc
|
package rpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/tidwall/gjson"
|
"github.com/tidwall/gjson"
|
||||||
"strings"
|
"strings"
|
||||||
@ -58,7 +60,9 @@ type result struct {
|
|||||||
//
|
//
|
||||||
// Date : 18:34 2022/6/30
|
// Date : 18:34 2022/6/30
|
||||||
func (r *result) ParseJSON(inputContent []byte, receiver interface{}) error {
|
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数据
|
// ParseYaml 解析yaml数据
|
||||||
|
Loading…
Reference in New Issue
Block a user