Open adonovan opened 2 weeks ago
During review of https://go.dev/cl/581555, @timothy-king pointed out that I had defined a local variable using an if/else statement and then failed to use it after the statement, something like this:
func f(pass *Pass), filename string) { readFile := pass.ReadFile if readFile == nil { readFile = os.ReadFile } os.ReadFile(filename) // oops, I meant readFile }
The assignment to readFile is a dead store. We should flag this is a likely error.
During review of https://go.dev/cl/581555, @timothy-king pointed out that I had defined a local variable using an if/else statement and then failed to use it after the statement, something like this:
The assignment to readFile is a dead store. We should flag this is a likely error.