Which of the following is a valid way to declare and initialize a slice of integers in Go?

1
s := []int{1, 2, 3}
2
s := make([]int, 3)
3
s := [3]int{1, 2, 3}
4
s := int[]{1, 2, 3}

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation