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