A slice points to an array of values and also includes a length.
[]T
is a slice with elements of type T
.
package main import "fmt" func main() {
p := []int{, , , , , }
fmt.Println("p ==", p) for i := ; i < len(p); i++ {
fmt.Printf("p[%d] == %d\n", i, p[i])
}
}