Skip to content

Commit 8949023

Browse files
committed
Fix linter warning
1 parent a77f39c commit 8949023

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

commands/instances.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,11 @@ func (s *arduinoCoreServerImpl) Init(req *rpc.InitRequest, stream rpc.ArduinoCor
402402
responseError(e.GRPCStatus())
403403
continue
404404
}
405-
defer tmpDir.RemoveAll()
406405

407406
// Install library into profile cache
408-
if err := tmpDir.CopyDirTo(libDir); err != nil {
407+
copyErr := tmpDir.CopyDirTo(libDir)
408+
_ = tmpDir.RemoveAll()
409+
if copyErr != nil {
409410
taskCallback(&rpc.TaskProgress{Name: i18n.Tr("Error installing library %s", libraryRef)})
410411
e := &cmderrors.FailedLibraryInstallError{Cause: fmt.Errorf("copying library to profile cache: %w", err)}
411412
responseError(e.GRPCStatus())

0 commit comments

Comments
 (0)