Length and capacity

Report a typo

Write the code below to create and initialize an int slice mySlice using the make function with len=8 and cap=12.

Write a program in Go
package main

import "fmt"

// nolint: gomnd // DO NOT remove this comment!
func main() {
// Use the `make` function to create `mySlice` with len=8 and cap=12 below:
mySlice := ?

fmt.Println(checkSlice(mySlice)) // DO NOT delete this line! it checks the slice len and cap.
}
___

Create a free account to access the full topic