Quick actions

cmd+k|ctrl+k

Navigation

Languages

Variables / Blank identifier / Essential Go

Snippet info

Language

Go

Visibility

public

Author

kkowalczyk

Created

2019-03-26T10:12:13Z

Updated

2019-03-26T10:12:13Z

package main

import "fmt"

func main() {
	pets := []string{"dog", "cat", "fish"}

	// range returns both the current index and value
	// but sometimes we only need one or the other
	for _, pet := range pets {
		fmt.Println(pet)
	}
}
INFO