Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
What are Maps? | Intro to Structs & Maps
Introduction to GoLang
course content

Conteúdo do Curso

Introduction to GoLang

Introduction to GoLang

1. Getting Started
2. Data Types
3. Control Structures
4. Functions
5. Arrays and Slices
6. Intro to Structs & Maps

bookWhat are Maps?

Maps are an implementation of hash maps in Golang. A hash map is a data structure that maps keys to values, where a key can be a value of a comparable data type, such as int, float, string, and so on. Values can range from simple string literals to arrays.

Note

In Go, a comparable datatype refers to a data type that supports comparison operations, such as equality and ordering. Comparable types are those that can be compared using the equality operators (== and !=) and the relational operators (<, <=, >, >=).

Below is a diagram representing a hash map:

In arrays, we use indexes to access the stored data at an index. In contrast, with maps, we use keys to access the corresponding values.

What is **NOT** correct about Maps

What is NOT correct about Maps

Selecione a resposta correta

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 6. Capítulo 4
We're sorry to hear that something went wrong. What happened?
some-alt