sing/common/json/internal/contextjson/unmarshal.go
2024-07-22 12:02:46 +08:00

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)
}