Skip to content

http related false positives after "skip import check" commit  #7

@scop

Description

@scop

After commit a2c3e11, v1.0.8, I'm getting reports that I think are false positives.

There's an underlying function

func WriteProblem(w http.ResponseWriter, r *http.Request, problem *Problem, originalError error) error

...which calls r.Context(), and another function that calls it (but not r.Context() directly) like

func writeProblemResponse(w http.ResponseWriter, r *http.Request, err error)

Now, every WriteProblem and writeProblemResponse call gets flagged as "should pass the context parameter". I suppose the intent is not to do that. r.Context() is used where a Context can be used.

v1.0.7 did not have this problem.

Also, for reasons I cannot explain, I'm also seeing this problem with golangci-lint v1.49.0, which uses contextcheck v1.0.6. But I cannot replicate the problem with contextcheck v1.0.6 directly 🤔

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