Sobes.tech
Junior — Senior

Comparison result of nil in Go

livecode

Task condition

Let's consider how Go compares values with nil for pointers and empty interfaces.

var s *string
fmt.Println(s == nil)

var i interface{}
fmt.Println(i == nil)

i = s
fmt.Println(i == nil)