package base import ( "database/sql/driver" "encoding/json" "fmt" ) type ResFields []ResField func (c *ResFields) Scan(value any) error { if value == nil { return nil } if err := json.Unmarshal(value.([]byte), c); err != nil { return fmt.Errorf("ResFields json.Unmarshal Error, %s", err) } return nil } func (c ResFields) Value() (driver.Value, error) { b, err := json.Marshal(c) return string(b), err }