honnef.co/go/tools@v0.4.7/staticcheck/testdata/src/example.com/CheckAddressIsNil/CheckAddressIsNil.go (about) 1 package pkg 2 3 func fn(x int, y *int) { 4 _ = &x == nil //@ diag(`the address of a variable cannot be nil`) 5 _ = &y != nil //@ diag(`the address of a variable cannot be nil`) 6 7 if &x != nil { //@ diag(`the address of a variable cannot be nil`) 8 println("obviously.") 9 } 10 11 if y == nil { 12 } 13 }