Get the latest tech news
Go Data Structures (2009)
Posted on Tuesday, November 24, 2009. 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.
defines a simple struct type named Point, represented as two adjacent int s in memory. Even with a fast allocator, that creates a lot of unnecessary work for the garbage collector, and we found that, as was the case with strings above, programs avoided slicing operations in favor of passing explicit indices. Removing the indirection and the allocation made slices cheap enough to avoid passing explicit indices in most cases.
Or read this on Hacker News