I have a custom time format that is the result of some custom unmarshalling:
type customTime struct {
time.Time
}
I have implemented the Scanner
and Valuer
interface on this customTime
like so:
func (ct *customTime) Scan(value interface{}) error {
ct.Time = value.(time.Time)
return nil
}
func (ct *customTime) Value() (driver.Value, error) {
return ct.Time, nil
}
But it still errs when I try to do the insert:
sql: converting Exec argument $3 type: unsupported type main.customTime, a struct
What am I missing?