Posts tagged with golang
-
Golang Switch Statements (A Complete Guide)
Switch statements in Go is are to execute a block of code among many alternatives. It is declared using the keyword switch followed by the condition to be evaluated.
-
Golang for loop (A Complete Guide)
In Golang for loop is used to iterate over a collection of data. In this tutorial, we will learn how to use for loop in Golang and the various patterns used in for loop.
-
Mastering Generics In Go: A Comprehensive Tutorial
Decode the mysteries of Golang generics through this thorough exploration. Learn to construct functions and types that work seamlessly with any data type. Explore the usage of empty interfaces, type parameters, and type inference for defining generics in Go.
-
Golang Map (A Complete Guide)
In Golang a map is a data structure that stores key-value pairs. In this article, we will learn about the map data structure in Golang.
-
How to print structs in Go
To print structs we use the fmt package i.e fmt.Printf("%v", structName). This will print the struct in the format of a map. To print the struct in a more readable format we use the %#v format specifier. This will print the struct in the format of a struct.