I'm trying to implement database/sql Scanner for my custom type that embeds
time.Time but I can't figure out how to properly do it without errors from
compiler.
type MyTime struct {
time.Time
}
func (t MyTime) Scan(src interface{}) error {
tt := src.(time.Time)
// Now having time.Time I would like to cast it to my MyType
return nil
}
I have tried few ways to do it but I always get an error. I appreciate any
help.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.