Go has fairly standard syntax for the three-component loop you’re used to from C, Java, or JavaScript. The big difference is the lack of parentheses surrounding the components. More often than not, you’ll be looping over a collection of items like a map, slice, channel, or string.

Related Articles