mirror of
https://github.com/go-gorm/gorm.git
synced 2025-03-14 09:56:52 +00:00
Allow to support other field types
This commit is contained in:
@ -84,7 +84,10 @@ func (JSONSerializer) Scan(ctx context.Context, field *Field, dst reflect.Value,
|
||||
case string:
|
||||
bytes = []byte(v)
|
||||
default:
|
||||
return fmt.Errorf("failed to unmarshal JSONB value: %#v", dbValue)
|
||||
bytes, err = json.Marshal(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(bytes) > 0 {
|
||||
|
Reference in New Issue
Block a user