// Scan is sql.Scanner interface implementation
Scan is sql.Scanner interface implementation
// Scan is sql . Scanner interface implementation
func (t *TimeUnixSeconds) Scan(src interface{}) error {
	if src == nil {
		*t = TimeUnixSeconds{}
		return nil
	}
	switch x := src.(type) {
	case []byte:
		sc := string(x)
		ic, err := strconv.Atoi(sc)
		if err != nil {
			return err
		}
		t.set(time.Unix(int64(ic), 0).UTC())
	case int64:
		t.set(time.Unix(x, 0).UTC())
	case int:
		t.set(time.Unix(int64(x), 0).UTC())
	case time.Time:
		t.set(x)
	default:
		return fmt.Errorf("unsupported type %T for scanning", src)
	}
	return nil
}
func ( t * TimeUnixSeconds ) Scan ( src interface { } ) error { if src == nil { * t = TimeUnixSeconds { } return nil } switch x := src . ( type ) { case [ ] byte : sc := string ( x ) ic , err := strconv . Atoi ( sc ) if err != nil { return err } t . set ( time . Unix ( int64 ( ic ) , 0 ) . UTC ( ) ) case int64 : t . set ( time . Unix ( x , 0 ) . UTC ( ) ) case int : t . set ( time . Unix ( int64 ( x ) , 0 ) . UTC ( ) ) case time . Time : t . set ( x ) default : return fmt . Errorf ( " " , src ) } return nil }
Scan is sql.Scanner interface implementation
Scan is sql . Scanner interface implementation