Lesson 9 of 60
GoPointers, Allocation, and the Garbage Collector
20 minutes
Course progress15%
Pointers
This lesson explains the main concept clearly with beginner-friendly examples and background so you can learn why the code works.
Go exposes pointers (*T) but does not allow pointer arithmetic.
var x int = 10
p := &x // p points to x
fmt.Println(*p) // 10
*p =