Created
September 30, 2014 16:13
-
-
Save jochasinga/2b7ab406021f797ea49a to your computer and use it in GitHub Desktop.
Special for loop in Go
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" | |
var arr = [10]int{ 1, 21, 35, 4, 30, 6, 12, 9, 4, 10 } | |
func main() { | |
// loop through arr and print out all values | |
for _, v := range arr { | |
fmt.Println(v) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment