mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-05 12:57:38 +03:00
12 lines
235 B
Go
12 lines
235 B
Go
package json
|
|
|
|
func UnmarshalDisallowUnknownFields(data []byte, v any) error {
|
|
var d decodeState
|
|
d.disallowUnknownFields = true
|
|
err := checkValid(data, &d.scan)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
d.init(data)
|
|
return d.unmarshal(v)
|
|
}
|