What do you want to save?
Add Code snippet
New code examples
-
Go 2021-09-28 22:31:02
golang iterate through slice
var slice = []string{"Apple", "Orange", "Kiwi"} for index, sliceItem := range slice { // You can omit index or sliceItem with a _ fmt.Println("Index in slice:", index) fmt.Println("Fruit:", sliceItem) } Add solution