Avatar ·

How to organize a loop over a range of integers in Go without using for i := 0; i < N; i++?

Hello everyone! I'm new to Go, coming from Python, and I'm a bit confused by the absence of the familiar `for i in range(10)` construct. In Python it was very convenient — just iterate over numbers from 0 to 9 without worrying about a counter. In Go I only see the classic for loop with three components: ```go for i := 0; i < 10; i++ { fmt.Println(i) } ``` This works, but looks cumbersome, especially when you just need to perform an action N times. Is there a more elegant way? For example, something like `for i := range 10`? I also noticed that Go has `range` for slices, maps, and channels: ```go nums := []int{1, 2, 3} for i, v := range nums { fmt.Println(i, v) } ``` But this doesn't work for a simple range of numbers. Please tell me, is there some idiomatic way to iterate over numbers from A