If you only need the index, you can omit the value variable:
nums := []int{10, 20, 30}
for i := range nums {
fmt.Println(i)
}
This prints , , . When you don't assign the second variable, Go only gives you the index. This is cleaner than using the blank identifier.