A coworker’s question the other day motivated me inspect the layout of certain Go objects in memory. Being a managed language, dumping arbitrary swaths of memory isn’t something that Go generally encourages. Doing so requires the unsafe package, whose name should inspire you with the appropriate degree of fear.
Note: This post presumes general familiarity with the way pointers operate. It’s easy to get confused when dealing with pointers, so you may want to pause and revisit pointers if you get lost.