Go Maps: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 15: Line 15:
</pre>
</pre>


Example:
Example of a map of string to ints:


<pre>
<pre>
var m map[string]string
var m map[string]int
</pre>
</pre>



Revision as of 02:25, 28 March 2016

Internal

Overview

A map is an unordered collection of key-value pairs.

Declaration

Long Declaration

var map_identifier map[key_type]value_type

Example of a map of string to ints:

var m map[string]int

Short Declaration

Map Operators and Functions