// Scan implements the database/sql Scanner interface. It will receive a value
// from an SQL database and assign it to t, so long as the provided data is of
// type nil or time.Time. All other types will result in an error.
Scan implements the database/sql Scanner interface. It will receive a value
from an SQL database and assign it to t, so long as the provided data is of
type nil or time.Time. All other types will result in an error.
// Scan implements the database / sql Scanner interface . It will receive a value // from an SQL database and assign it to t so long as the provided data is of // type nil or time . Time . All other types will result in an error .
func (t *Time) Scan(src interface{}) error {
	if t == nil {
		return fmt.Errorf("null.Time: Scan called on nil pointer")
	}
	switch val := src.(type) {
	case time.Time:
		t.Time = val
		t.Valid = true
		return nil
	case nil:
		t.Time = time.Time{}
		t.Valid = false
		return nil
	default:
		return fmt.Errorf("null.Time: cannot scan type %T (%v)", val, src)
	}
}
func ( t * Time ) Scan ( src interface { } ) error { if t == nil { return fmt . Errorf ( " " ) } switch val := src . ( type ) { case time . Time : t . Time = val t . Valid = true return nil case nil : t . Time = time . Time { } t . Valid = false return nil default : return fmt . Errorf ( " " , val , src ) } }
Scan implements the database/sql Scanner interface.
Scan implements the database / sql Scanner interface .