for loop go through array code example
Example: golang loop through array
arr := []int{1, 2, 3, 4, 5}
//using range
for index, ele := range arr { // you can escape index by _ keyword
fmt.Println(index, ele)
}
arr := []int{1, 2, 3, 4, 5}
//using range
for index, ele := range arr { // you can escape index by _ keyword
fmt.Println(index, ele)
}