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