cast
cast copied to clipboard
cast v1.5.0 bug
func ToUint64E(i interface{}) (uint64, error) use the v, err := strconv.ParseInt(trimZeroDecimal(s), 0, 0) error:strconv.ParseInt: parsing "11166014772858028509": value out of range unable to cast "11166014772858028509" of type string to uint64
case string: v, err := strconv.ParseInt(trimZeroDecimal(s), 0, 0) if err == nil { if v < 0 { return 0, errNegativeNotAllowed } return uint64(v), nil } return 0, fmt.Errorf("unable to cast %#v of type %T to uint64", i, i)