Partially revert the change made in https://github.com/go-gorm/gorm/pull/6311 that appears to have broken this for us and at least one other person.
This commit is contained in:
parent
05110579be
commit
72e580c566
@ -12,6 +12,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/now"
|
||||
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/utils"
|
||||
)
|
||||
@ -922,7 +923,7 @@ func (field *Field) setupValuerAndSetter() {
|
||||
if !reflectV.IsValid() {
|
||||
field.ReflectValueOf(ctx, value).Set(reflect.New(field.FieldType).Elem())
|
||||
} else if reflectV.Kind() == reflect.Ptr && reflectV.IsNil() {
|
||||
return
|
||||
field.ReflectValueOf(ctx, value).Set(reflect.New(field.FieldType).Elem())
|
||||
} else if reflectV.Type().AssignableTo(field.FieldType) {
|
||||
field.ReflectValueOf(ctx, value).Set(reflectV)
|
||||
} else if reflectV.Kind() == reflect.Ptr {
|
||||
|
@ -1,6 +1,8 @@
|
||||
module gorm.io/gorm/tests
|
||||
|
||||
go 1.18
|
||||
go 1.21
|
||||
|
||||
toolchain go1.23.2
|
||||
|
||||
require (
|
||||
github.com/google/uuid v1.6.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user