Refactor to use reflect.TypeFor

This commit is contained in:
cui
2025-08-21 22:10:07 +08:00
committed by GitHub
parent 50f95dd909
commit 86422af988
5 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ func fill(field reflect.Value) error {
setTyped(field, int32(defaultNumber))
case reflect.Int64:
switch field.Type() {
case reflect.TypeOf(types.Duration(time.Second)):
case reflect.TypeFor[types.Duration]():
setTyped(field, types.Duration(defaultNumber*time.Second))
default:
setTyped(field, int64(defaultNumber))