Introduction

Completed

In previous modules, we covered the basic data types in Go that serve as the foundation for building data structures in a Go program. In this module, we'll cover the aggregate types we mentioned earlier: arrays and slices. You'll learn the differences between the two and when to use one type versus the other one. We'll also cover maps and structs, which are the foundation for manipulating data by using Go and used for many web services.

Last, you'll learn how to build custom and complex data types, which will be useful when you parse JSON payloads.

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.

Prerequisites

  • A Go environment ready to create applications. Ideally, you should have Go installed and configured locally, and have 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.