Good point integer overflow. Thanks!

On Thursday, June 30, 2016 at 10:30:46 AM UTC-6, Andy Balholm wrote:
>
> When a function is used incorrectly, a panic is appropriate. If the count 
> comes from an untrusted source, the caller should check that it is 
> non-negati!e (and not too large) before calling Repeat, rather than 
> checking an error afterward. 
>
> Using a uint would actually be worse, since uint(int(-1)) is an extremely 
> large number. 
>
> Andy

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to