Use range to iterate over array elements:
numbers := [5]int{10, 20, 30, 40, 50}
for i, v := range numbers {
fmt.Printf("Index %d: %d\n", i, v)
}
The range keyword gives you both the index and the value. If you only need the value, use _ for the index. If you only need the index, omit the second variable entirely.