Pointers in Golang

Rene Manqueros
May 30 · 7 min read

Pointers are a very basic but extremely powerful tool that are mostly misunderstood and considered as a difficult or frustrating concept when programming. Pointers were created to help pass data around the code without having to create copies of the variables, thus not using extra memory.

Some languages avoid the concept, others partially embrace it but in Go we have pointers as they were meant to be: ̶a̶n̶ ̶i̶n̶s̶t̶r̶u̶m̶e̶n̶t̶ ̶o̶f̶ ̶t̶o̶r̶t̶u̶r̶̶e a great tool to optimize performance.

A pointer is a variable that references a certain location in memory where a value…