When explaining Go to new programmers, I've found that it often helps to explain what Go values look like in memory, to build the right intuition about which operations are expensive and which are not. This post is about basic types, structs, arrays, and slices. Basic types Let's start with some simple examples: The variable i has type int, represented in memory as a single 32-bit word. (All these
![research!rsc: Go Data Structures](https://cdn-ak-scissors.b.st-hatena.com/image/square/011d2e045ef2cb9f42eda313b09bcf80c3e567c9/height=288;version=1;width=512/http%3A%2F%2Fresearch.swtch.com%2Fgodata4.png)