I'm just curious why functions such as len() and cap() return an 'int'
instead of a 'uint'. I see several downsides of using signed types in these
(1) it's confusing since it's implied that negative values might be
returned (and perhaps should be checked for?), and
(2) it throws away half of the usable values for the type
(2147483648 values thrown out on 32-bit machines)
It's of course a pedantic observation, but for a language with a focus on
correctness such as Go, why are signed types used in such situations?
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 email@example.com.
For more options, visit https://groups.google.com/groups/opt_out.