Golang for range The `for range` loop in Golang is used to iterate over elements in an array, slice, string, map, or channel.It returns both the index and the corresponding element value.
Here is an example of using `for range` with a single code block: