Arrays automatic length


There was a slight duplication of information in the above example as we could have deducted the size from the list of initial values. This happens with the 3 dots.

examples/array-auto-length/array_auto_length.go
package main

import (
    "fmt"
)

func main() {
    var res = [...]int{7, 5, 9}

    fmt.Println(res)
    fmt.Println(res[1])
    fmt.Println(len(res))

    fmt.Printf("%T\n", res)
}

[7 5 9]
5
3
[3]int