2 ms·
There is a subtle yet key difference between range and for. Ranges will only start execution on input of known size and guarantee termination. Regular for loops
by jamesmiller5 12y ago
There is a subtle yet key difference between range and for. Ranges will only start execution on input of known size and guarantee termination. Regular for loops do not require a terminating state.
- burntsushi 12y ago> Ranges will only start execution on input of known size and guarantee termination. `range` can be used to receive values on a channel, which is certainly not a known size and doesn't have guaranteed termination.