This commit is contained in:
MarkJoyMa
2023-03-02 21:47:07 +08:00
committed by kevin
parent b4c2677eb9
commit 52265087d1
4 changed files with 34 additions and 2 deletions

View File

@@ -32,7 +32,8 @@ type fieldInfo struct {
mapField *fieldInfo
}
// FillDefault fills the default values for the given v.
// FillDefault fills the default values for the given v,
// and the premise is that the value of v must be guaranteed to be empty
func FillDefault(v any) error {
return fillDefaultUnmarshaler.Unmarshal(map[string]any{}, v)
}