I have this 2 lines of code:
parsedCapacity, _ := strconv.ParseInt(formCapacity, 10, 0)
capacity := int(parsedCapacity)
As you can see I am ignoring the second return parameter, the error,
parsedCapacity is int64 and for simplicity I am casting capacity to int.
Is there any other way to write this 2 lines of code?
parsedCapacity for me acts like a temporary variable, I would like to be
able to do the conversion and casting without having to maintain this
temporary variable of undesirable type.
Thanks,
DC
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.