mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-26 11:01:07 +01:00
fix(serialization): default value lookup
This commit is contained in:
@@ -59,7 +59,7 @@ func RegisterDefaultValueFactory[T any](factory func() *T) {
|
||||
// otherwise, initialize the ptr with zero value.
|
||||
func initPtr(dst reflect.Value) {
|
||||
dstT := dst.Type()
|
||||
if dv, ok := defaultValues[dstT]; ok {
|
||||
if dv, ok := defaultValues[dstT.Elem()]; ok {
|
||||
dst.Set(reflect.ValueOf(dv()))
|
||||
} else {
|
||||
gi.ReflectInitPtr(dst)
|
||||
|
||||
Reference in New Issue
Block a user