Improve usages of json.Unmarshal

This commit is contained in:
世界
2024-10-13 13:07:02 +08:00
parent 9b8d6c1b73
commit f4f5a3c925
3 changed files with 4 additions and 8 deletions
+1 -1
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))
}