go get items in a list code example
Example 1: go get items in a list
for i, x := range items {
fmt.Printf("Item %d = %v \n", i, x)
}
Example 2: go get items in a list
for _, x := range items {
doSomething(x)
}
for i, x := range items {
fmt.Printf("Item %d = %v \n", i, x)
}
for _, x := range items {
doSomething(x)
}