Use data types and structs, arrays, slices, and maps in Go


Learn about structs, arrays, slices, and maps. Understand the difference between them and when to use one type over the other.

Learning objectives

In this module, you'll learn about:

  • The aggregate types in Go: arrays and slices.
  • The differences between arrays and slices.
  • Built-in functions to manipulate data.
  • How to use key and value data structures by using maps.
  • How to write complex custom data types with structs.


  • A Go environment ready to create applications. Ideally, you should have installed and configured Go locally and Visual Studio Code with the Go extension installed.
  • Be able to create and modify .go files.
  • Be able to run Go applications by using the terminal prompt.
  • Have knowledge of basic data types like string, int, and boolean.
  • Have knowledge of how to write basic data control flows like if and for statements.