Size Go

[Solved] Size Go | Go - Code Explorer | yomemimo.com
Question : size go

Answered by : armando-flores

var array [4]int
slice := []int{0, 1, 2, 3}
fmt.Println(len(array)) //Outputs 4 as lenght of array
fmt.Println(len(slice)) //Outputs 4 as lenght of slice
//len() is only used with array or slices

Source : | Last Update : Sun, 26 Jun 22

Answers related to size go

Code Explorer Popular Question For Go