style(backup): satisfy errcheck on deferred Close calls
Wrap deferred rc.Close() in closures to explicitly discard the error. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
81acfac025
commit
d7c1abbfb6
@ -25,7 +25,7 @@ func readZipEntry(t *testing.T, data []byte, name string) []byte {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("open %s: %v", name, err)
|
t.Fatalf("open %s: %v", name, err)
|
||||||
}
|
}
|
||||||
defer rc.Close()
|
defer func() { _ = rc.Close() }()
|
||||||
b, err := io.ReadAll(rc)
|
b, err := io.ReadAll(rc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("read %s: %v", name, err)
|
t.Fatalf("read %s: %v", name, err)
|
||||||
|
|||||||
@ -56,7 +56,7 @@ func ReadManifest(r io.ReaderAt, size int64) (*Manifest, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to open manifest.json: %w", err)
|
return nil, fmt.Errorf("failed to open manifest.json: %w", err)
|
||||||
}
|
}
|
||||||
defer rc.Close()
|
defer func() { _ = rc.Close() }()
|
||||||
|
|
||||||
data, err := io.ReadAll(rc)
|
data, err := io.ReadAll(rc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user