Fun With Pointers

By Daniela Petruzalek

Elevator Pitch

Even though my definition of fun may be different than yours (very likely! ^_^), in this talk you will learn how to use pointers effectively in Go. We’ll cover from the basics of pointer declaration and usage, to the differences of allocation on the stack vs the heap and some interesting scenarios.

Description

In this talk you will learn how to use pointers effectively in Go. We’ll cover from the basics of pointer declaration and usage, to the implications of allocating memory on the stack versus the heap. We’ll also see some practical use cases and interesting behaviours when using pointers, including when to use pointer receivers vs value receivers, unsafe package tricks and when a nil pointer is not exactly nil (hint: interfaces!).

This talk was previously presented at Gophercon UK 2019. Video: https://www.youtube.com/watch?v=yEiaCx0fR9k