You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
r, err:=gzip.NewReader(file)
deferr.Close() // this outputs file.go:123:2: should check returned error before deferring r.Close() (SA5001)iferr!=nil {
log.Fatalf("error: %s", err)
}
the error message is a little confusing because it looked to me like it was saying that I needed to check the error from defer r.Close() rather than what it actually meant which is that I needed to check the error from gzip.NewReader before attempting to close
the error message is a little confusing because it looked to me like it was saying that I needed to check the error from
defer r.Close()
rather than what it actually meant which is that I needed to check the error fromgzip.NewReader
before attempting to closestaticcheck version:
staticcheck 2023.1.6 (v0.4.6)
staticcheck debug version:
go version:
go version go1.21.0 linux/amd64
The text was updated successfully, but these errors were encountered: