To declare an empty slice, with a non-fixed size,
is it better to do:

mySlice1 := make([]int, 0)

or:

mySlice2 := []int{}

Just wondering which one is the correct way.

5 Answers
5

Leave a Reply

Your email address will not be published. Required fields are marked *