Daftar Loop Golang
a := []string{"Foo", "Bar"}
for i, s := range a {
fmt.Println(i, s)
}
Bored Badger
a := []string{"Foo", "Bar"}
for i, s := range a {
fmt.Println(i, s)
}
nums := []int{2, 3, 4}
sum := 0
for _, num := range nums {
sum += num
}
fmt.Println("sum:", sum)
for index, element := range someSlice {
// index is the index where we are
// element is the element from someSlice for where we are
}