Skip to content

False-positives alerts for interface type conversions #259

@Ragnar-BY

Description

@Ragnar-BY

Last version golangci-lint use errcheck v1.8.0
Now errcheck gives alerts for code like:

	var a interface{}
	a = 5

	switch a.(type) {
	case string:
		fmt.Println("this is string", a.(string))
	case int:
		fmt.Println("this is int", a.(int))
	default:
		fmt.Println("unknown type")
	}

I think it is related to changes from #246
I believe that it is false-positive, because type is checked in switch-case

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