typednil typednil finds a comparison between typed nil and untyped nil. func f() { err := e() if err != nil { // true print(err) } } func e() error { var err *struct{error} return err }