Skip to content

False positive for functions in map #82

@mholt

Description

@mholt
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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions