Golang Project Structure

Tutorials, tips and tricks for writing and structuring code in Go (with some additional content for other programming languages)

loops

Tag

Why Does Go Have So Many Different Kinds of For Loop?

A long-exposure photograph of a roundabout at night. No cars can be seen, but the trail left by their white and red headlights and taillights remains.

Anyone with experience of a C-based programming language will be immediately aware of how useful and fundamental for loops are. C also has while and do–while loops. JavaScript has a forEach method, which allows us to iterate over arrays, and it also has iterator objects. Go only really has the for loop. However, this single […]