uber-go / nilaway

Static analysis tool to detect potential nil panics in Go code
Apache License 2.0
3.19k stars 66 forks source link

False positive in named type receiver #289

Open sonalmahajan15 opened 1 month ago

sonalmahajan15 commented 1 month ago

The below code results in a false positive.

type mySlice []int

func (ma mySlice) bar() {}

func foo() mySlice {
    var m mySlice
    return m
}

func test() {
    m := foo()
    m.bar() // FP here
}
sikehish commented 1 month ago

Can I be assigned to this issue?

muqeeth26832 commented 1 month ago

can i get assigned to this issue?