Here is simple example:
package main
import "fmt"
type A struct {
Name *string
}
type B struct {
A *A
}
func main() {
deref(&B{})
}
func deref(b *B) {
fmt.Println(*b.A.Name) // panic: nil pointer dereference
}
I'm looking for a solution that can find this type of situations. There is a "nillness check" in Jetbrains Goland but it doesn't inspect this issue.