nilaway icon indicating copy to clipboard operation
nilaway copied to clipboard

not detected

Open comerc opened this issue 4 months ago • 0 comments

package main

import (
	"bytes"
	"io"
)

func fn(out io.Writer) {
	if out != nil {
		out.Write([]byte("OK\n"))
	}
}

func main() {
	// case 1: detected
	var a *int
	b := *a // panic
	println(b)

	// case 2: not detected
	var buf *bytes.Buffer = nil
	fn(buf) // panic
}

comerc avatar Aug 21 '25 20:08 comerc