Skip to content

Instantly share code, notes, and snippets.

@jochasinga
Created September 30, 2014 15:42
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 jochasinga/b2b144ac145f64af2366 to your computer and use it in GitHub Desktop.
Save jochasinga/b2b144ac145f64af2366 to your computer and use it in GitHub Desktop.
Looping in an array
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 i := 0; i < len(arr); i++ {
fmt.Println(arr[i])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment