插入自定义时间,实现了Scanner和Valuer,但仍然出错

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?

Found the solution, Scanner and Valuer should be implemented on the actual value and not a pointer to the customTime

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
}