maps/

directory
v0.0.0-...-86d22a7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2017 License: Apache-2.0

README

Maps

Maps provide a data structure that allow for the storage and management of key/value pair data.

Notes

  • Maps provide a way to store and retrieve key/value pairs.
  • The map key must be a value that can be used in an assignment statement.
  • Iterating over a map is always random.

http://blog.golang.org/go-maps-in-action
http://www.goinggo.net/2013/12/macro-view-of-map-internals-in-go.html
Keith Randall - Inside the Map Implementation

Code Review

Declare, initialize and iterate (Go Playground)
Map literals and delete (Go Playground)
Map key restrictions (Go Playground)

Exercises

Exercise 1

Declare and make a map of integer values with a string as the key. Populate the map with five values and iterate over the map to display the key/value pairs.

Template (Go Playground) | Answer (Go Playground)


All material is licensed under the Apache License Version 2.0, January 2004.

Directories

Path Synopsis
Sample program to show how to declare, initialize and iterate over a map.
Sample program to show how to declare, initialize and iterate over a map.
Sample program to show how to declare and initialize a map using a map literal and delete a key.
Sample program to show how to declare and initialize a map using a map literal and delete a key.
Sample program to show how only types that can have equality defined on them can be a map key.
Sample program to show how only types that can have equality defined on them can be a map key.
exercises
exercise1
Declare and make a map of integer values with a string as the key.
Declare and make a map of integer values with a string as the key.
template1
Declare and make a map of integer values with a string as the key.
Declare and make a map of integer values with a string as the key.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL