Values & References5 / 15
Up next

The nil pointer

package main

import "fmt"

func main() {
	var p *int
	fmt.Println(p == nil) // true
	n := 5
	p = &n
	fmt.Println(p != nil, *p)
}
What you're solving

a pointer's zero value is nil