var cmdMap = map[string]func() error{
"cmd1": func() error { // OK
return errors.New("foo")
},
"cmd2": func() error { // false positive
return nil
},
}
In this code, I think it's pretty clear cmd2 needs to have an error return because the signature of the map value mandates it, but it gets flagged as "result 0 (error) is always nil".
In this code, I think it's pretty clear
cmd2needs to have anerrorreturn because the signature of the map value mandates it, but it gets flagged as "result 0 (error) is always nil".