for loop on values of array (no index)



examples/for-array-values/for_array_values.go
package main

import "fmt"

func main() {
    dwarfs := [...]string{"Doc", "Grumpy", "Happy", "Sleepy", "Bashful", "Sneezy", "Dopey"}
    for _, name := range dwarfs {
        fmt.Println(name)
    }
}

examples/for-array-values/for_array_values.out
Doc
Grumpy
Happy
Sleepy
Bashful
Sneezy
Dopey