diff --git a/scope.go b/scope.go index d1b11615..d7db341e 100644 --- a/scope.go +++ b/scope.go @@ -107,7 +107,7 @@ func (scope *Scope) PrimaryKeyField() *Field { if typ.Kind() == reflect.Ptr { typ = typ.Elem() } - clone = scope.New(reflect.New(typ).Elem().Interface()) + clone = scope.New(reflect.New(typ).Elem().Addr().Interface()) } for _, field := range clone.Fields() {