slice4.goΒΆ

// slice4.go

// To run at the command line:
//    $ go run slice4.go

package main

import "fmt"

func main() {
    // counts1 is a new slice of length 5, capacity 5
    counts1 := make([]int, 5)
    fmt.Println(counts1)

    // counts2 is a new slice of length 5, capacity 10
    counts2 := make([]int, 5, 10)
    fmt.Println(counts2)
}