The golang builtin function len() can be used to get the length of the map which is number of key-value pairs present in the map. Below is the format for using this…
Category: Tech
Maps in Go (Golang)
This is the chapter 19 of the golang comprehensive tutorial series. Refer to this link for other chapters of the series – Golang Comprehensive Tutorial Series Next Tutorial – MethodPrevious Tutorial – Slice Now let’s check…
Slice in Go (Golang)
This is the chapter 18 of the golang comprehensive tutorial series. Refer to this link for other chapters of the series – Golang Comprehensive Tutorial Series Next Tutorial – MapsPrevious Tutorial – Array Now let’s check…
Print an array or slice elements in Go (Golang)
Overview The way we print an array or slice is same. Let’s look at both one by one Print a Slice Print slice elements together Using fmt.Println and fmt.Printf Output Print individual…
Copy an array or slice in Go (Golang)
Overview Array are value types in go while slice is a reference type. Hence there is a difference in the way how an array or slice can be copied to another array…
Append function in Go (Golang)
go builtin package provides an append function that can be used to append to a slice at the end. Below is the signature of this function The first argument is the slice…
Copy function in Go (Golang)
go builtin package provides copy function that can be used to copy a slice. Below is the signature of this function. It takes in two slices dst and src, and copies data…
Two Dimensional (2d) and Multi-Dimensional Array and Slice in Go (Golang)
In go multi-dimension is possible for both array and slice. Let’s see both of them in detail. Multi-Dimensional Arrays Overview Below is the format for declaring a multidimensional dimensional array where len1…
Understanding Array in Go (Golang) – Complete Guide
This is the chapter 17 of the golang comprehensive tutorial series. Refer to this link for other chapters of the series – Golang Comprehensive Tutorial Series Next Tutorial – SlicePrevious Tutorial – Struct Now let’s check…
Understand for-range Loop in go (golang) – Complete Guide
This is the chapter 11 of the golang comprehensive tutorial series. Refer to this link for other chapters of the series – Golang Comprehensive Tutorial Series Next Tutorial – If ElsePrevious Tutorial – For Loop Now…