# Macro View of Map Internals In Go

DevFeed: [Macro View of Map Internals In Go](<https://devfeed.tech/articles/macro-view-of-map-internals-in-go-22087.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2013/12/macro-view-of-map-internals-in-go.html>)

Published: 2013-12-31T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [blog](<https://devfeed.tech/tags/blog.md>), [fmt](<https://devfeed.tech/tags/fmt.md>), [go](<https://devfeed.tech/tags/go.md>), [go-programming](<https://devfeed.tech/tags/go-programming.md>), [golang](<https://devfeed.tech/tags/golang.md>), [hash](<https://devfeed.tech/tags/hash.md>), [internals](<https://devfeed.tech/tags/internals.md>), [map](<https://devfeed.tech/tags/map.md>), [maps](<https://devfeed.tech/tags/maps.md>), [memory](<https://devfeed.tech/tags/memory.md>), [padding](<https://devfeed.tech/tags/padding.md>), [programming](<https://devfeed.tech/tags/programming.md>), [range](<https://devfeed.tech/tags/range.md>)

## AI overview

This tutorial explains how Go maps are created and used, why iteration order is not guaranteed, and how maps are organized internally as hash tables with power-of-two bucket counts. It also introduces bucket selection, overflow, and memory padding.

## Source excerpt

Introduction There are lots of posts that talk about the internals of slices, but when it comes to maps, we are left in the dark. I was wondering why and then I found the code for maps and it all made sense. https://golang.org/src/runtime/hashmap.go At least for me, this code is complicated. That being said, I think we can create a macro view of how maps are structured and grow. This should explain why they are unordered, efficient and fast. Creating and Using Maps Let's look at how we can use a map literal to create a map and store a few values: