fix(lint): exclude common fire-and-forget patterns from errcheck
This commit is contained in:
parent
104820f4fe
commit
c0fd8d3818
8 changed files with 25 additions and 12 deletions
|
|
@ -97,8 +97,7 @@ func DownloadFFprobe() (string, error) {
|
|||
if err != nil {
|
||||
return "", fmt.Errorf("download failed: %w", err)
|
||||
}
|
||||
defer resp.Body.Close() //nolint:errcheck // best-effort close
|
||||
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return "", fmt.Errorf("download failed: HTTP %d", resp.StatusCode)
|
||||
}
|
||||
|
|
@ -167,7 +166,7 @@ func extractFromZip(data []byte, target string) ([]byte, error) {
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot extract %s from archive: %w", target, err)
|
||||
}
|
||||
defer rc.Close() //nolint:errcheck // best-effort close
|
||||
defer rc.Close()
|
||||
return io.ReadAll(rc)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue