Skip to content

Instantly share code, notes, and snippets.

@colynb
Created June 13, 2017 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colynb/99231419bbd5d273759a76c864b84c41 to your computer and use it in GitHub Desktop.
Save colynb/99231419bbd5d273759a76c864b84c41 to your computer and use it in GitHub Desktop.
Golang slice example
package main
import (
"fmt"
)
func main() {
mySlice := []string{"One", "Two", "Three"}
for index, item := range mySlice {
fmt.Println(index, item)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment