|
@@ -1,8 +1,6 @@
|
|
package option
|
|
package option
|
|
|
|
|
|
import (
|
|
import (
|
|
- "bytes"
|
|
|
|
-
|
|
|
|
"github.com/sagernet/sing/common"
|
|
"github.com/sagernet/sing/common"
|
|
E "github.com/sagernet/sing/common/exceptions"
|
|
E "github.com/sagernet/sing/common/exceptions"
|
|
"github.com/sagernet/sing/common/json"
|
|
"github.com/sagernet/sing/common/json"
|
|
@@ -69,7 +67,5 @@ func UnmarshallExcluded(inputContent []byte, parentObject any, object any) error
|
|
if err != nil {
|
|
if err != nil {
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
- decoder := json.NewDecoder(bytes.NewReader(inputContent))
|
|
|
|
- decoder.DisallowUnknownFields()
|
|
|
|
- return decoder.Decode(object)
|
|
|
|
|
|
+ return json.UnmarshalDisallowUnknownFields(inputContent, object)
|
|
}
|
|
}
|