All tagged tutorial

Type parameters in Go

Now that generics have come to Go, let's take a look at the new syntax for type parameters. We’ll find out why we need type parameters, how we write them, and how we can use them to create generic functions in Go.

Generics in Go

Generics what now? This friendly, down-to-earth tutorial series explains how Go’s generic functions and types work, why we need them, and where we can use them.

Go maps FAQ

What is a map in Golang and how does it work? Are Go maps thread-safe? Are maps pointers? How do you check if a map is empty? Can maps be nil? Go teacher and expert John Arundel answers these and other questions about Go maps.

map[string]interface{} in Go

What is a map[string]interface{} or map[string]any in Go, and why is it so useful? How do we deal with maps of string to interface{} in our programs? What the heck is an interface{}, anyway?

Iterating over a Golang map

How do you iterate over Golang maps? How do you print a map? How do you write a for loop that executes for each key and value in a map? What is the iteration order of Go maps? Let's find out, in this practical, easy-to-follow tutorial.

Finding whether a Go map key exists

What happens if you look up a key in a Go map that doesn’t exist? How do you check if a key is present in a map? How do you represent a set of objects as a map in Golang, and efficiently check whether a given value is in the set?

Storing and retrieving map values

More about Golang maps: looking up keys, adding and updating values, and how to update the fields of a struct within a map. This mini-tutorial is part of a series on everything you need to know about maps in Go!

Map types in Golang

What map types exist in Go? What data types can we use as map keys? What about map values? Are different kinds of maps considered distinct types? And what’s the difference between nil and empty maps? Find out in this handy, bite-size tutorial on map types in Golang.

Go maps: declaring and initializing

What is a Golang map? Why is it useful? How does it compare to a slice? How do you declare a map? How do you initialize a map in Go? Fear not, all these questions are answered in this friendly introduction to one of Go’s most powerful features.

Building a Golang Docker image

Let's build a Docker container with Golang! It sounds complicated, but it really isn't. All you need are a few tools, a couple of simple commands, and ideally some cake. (The cake isn't strictly necessary, but coding is hungry work.)