mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-04-05 04:47:37 +03:00
Remove go-json
This commit is contained in:
parent
75508bccb5
commit
0347a7c038
10 changed files with 14 additions and 40 deletions
|
@ -49,7 +49,7 @@ func (m *JSONObject) UnmarshalJSON(content []byte) error {
|
|||
}
|
||||
err = m.decodeJSON(decoder)
|
||||
if err != nil {
|
||||
return err
|
||||
return E.Cause(err, "decode json object content")
|
||||
}
|
||||
objectEnd, err := decoder.Token()
|
||||
if err != nil {
|
||||
|
@ -63,14 +63,15 @@ func (m *JSONObject) UnmarshalJSON(content []byte) error {
|
|||
func (m *JSONObject) decodeJSON(decoder *json.Decoder) error {
|
||||
for decoder.More() {
|
||||
var entryKey string
|
||||
err := decoder.Decode(&entryKey)
|
||||
keyToken, err := decoder.Token()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
entryKey = keyToken.(string)
|
||||
var entryValue any
|
||||
entryValue, err = decodeJSON(decoder)
|
||||
if err != nil {
|
||||
return err
|
||||
return E.Cause(err, "decode value for ", entryKey)
|
||||
}
|
||||
m.Put(entryKey, entryValue)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue