MCPcopy
hub / github.com/go-gorm/gorm / Scan

Method Scan

schema/serializer.go:119–126  ·  view source on GitHub ↗

Scan implements serializer interface

(ctx context.Context, field *Field, dst reflect.Value, dbValue interface{})

Source from the content-addressed store, hash-verified

117
118// Scan implements serializer interface
119func (UnixSecondSerializer) Scan(ctx context.Context, field *Field, dst reflect.Value, dbValue interface{}) (err error) {
120 t := sql.NullTime{}
121 if err = t.Scan(dbValue); err == nil && t.Valid {
122 err = field.Set(ctx, dst, t.Time.Unix())
123 }
124
125 return
126}
127
128// Value implements serializer interface
129func (UnixSecondSerializer) Value(ctx context.Context, field *Field, dst reflect.Value, fieldValue interface{}) (result interface{}, err error) {

Callers

nothing calls this directly

Calls 2

ScanMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected