@@ -66,7 +66,7 @@ func (e *Executor) Dump(ctx context.Context, opts DumpOptions) (DumpResults, err
6666 if err != nil {
6767 return results , fmt .Errorf ("failed to make temporary working directory: %v" , err )
6868 }
69- defer os .RemoveAll (tmpdir )
69+ defer func () { _ = os .RemoveAll (tmpdir ) }( )
7070 // execute pre-backup scripts if any
7171 if err := preBackup (ctx , timepart , path .Join (tmpdir , sourceFilename ), tmpdir , opts .PreBackupScripts , logger .Level == log .DebugLevel ); err != nil {
7272 return results , fmt .Errorf ("error running pre-restore: %v" , err )
@@ -77,7 +77,7 @@ func (e *Executor) Dump(ctx context.Context, opts DumpOptions) (DumpResults, err
7777 if err != nil {
7878 return results , fmt .Errorf ("failed to make temporary cache directory: %v" , err )
7979 }
80- defer os .RemoveAll (workdir )
80+ defer func () { _ = os .RemoveAll (workdir ) }( )
8181
8282 dw := make ([]database.DumpWriter , 0 )
8383
@@ -125,7 +125,7 @@ func (e *Executor) Dump(ctx context.Context, opts DumpOptions) (DumpResults, err
125125 tarSpan .End ()
126126 return results , fmt .Errorf ("failed to open output file '%s': %v" , outFile , err )
127127 }
128- defer f .Close ()
128+ defer func () { _ = f .Close () } ()
129129 cw , err := compressor .Compress (f )
130130 if err != nil {
131131 tarSpan .SetStatus (codes .Error , err .Error ())
@@ -138,7 +138,7 @@ func (e *Executor) Dump(ctx context.Context, opts DumpOptions) (DumpResults, err
138138 return results , fmt .Errorf ("error creating the compressed archive: %v" , err )
139139 }
140140 // we need to close it explicitly before moving ahead
141- f .Close ()
141+ defer func () { _ = f .Close () } ()
142142 tarSpan .SetStatus (codes .Ok , "completed" )
143143 tarSpan .End ()
144144
0 commit comments