From c2c22dca0bf23678ca53446a2f0a210d4303dd71 Mon Sep 17 00:00:00 2001 From: yusing Date: Wed, 1 Oct 2025 20:09:03 +0800 Subject: [PATCH] fix(serialization): default value lookup --- internal/serialization/serialization.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/serialization/serialization.go b/internal/serialization/serialization.go index 51699827..9736cf2c 100644 --- a/internal/serialization/serialization.go +++ b/internal/serialization/serialization.go @@ -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)