Skip to content

False positive with closure outside of if body #77

@silverwind

Description

@silverwind
var rc io.ReadCloser
if true {
  resp, err := http.Get("http://foo")
	rc = resp.Body
  if err != nil {
  	print(err)
  }
}
defer rc.Close()

This highlights a false-positive when resp.Body is closed outsite the if body. Removing the if wrapping makes it correctly detect it.

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