2 ms·
Right, you do use the C-style for loop for numeric iteration. The reason why a more succinct form for numeric iteration isn't there is that Go has no generics,
by pcwalton 11y ago
Right, you do use the C-style for loop for numeric iteration.
The reason why a more succinct form for numeric iteration isn't there is that Go has no generics, therefore no generic interfaces, therefore no Iterator interface, therefore no iterators. So Go had no choice but to build all syntaxes that look like iterators directly into the language.