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-negative (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