Created
June 13, 2017 18:32
-
-
Save colynb/99231419bbd5d273759a76c864b84c41 to your computer and use it in GitHub Desktop.
Golang slice example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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