Improve usages of json.Unmarshal

This commit is contained in:
世界
2024-07-22 12:10:22 +08:00
parent 9b8d6c1b73
commit f4f5a3c925
3 changed files with 4 additions and 8 deletions

View File

@@ -26,5 +26,5 @@ func (o *UDPOverTCPOptions) UnmarshalJSON(bytes []byte) error {
if err == nil {
return nil
}
return json.Unmarshal(bytes, (*_UDPOverTCPOptions)(o))
return json.UnmarshalDisallowUnknownFields(bytes, (*_UDPOverTCPOptions)(o))
}