updated dependencies and golangci-lint to v2

This commit is contained in:
Gani Georgiev
2025-04-12 20:04:04 +03:00
parent d9af1475ef
commit 4cc797071b
18 changed files with 93 additions and 109 deletions
+3 -3
View File
@@ -204,13 +204,13 @@ func (p *plugin) update(withBackup bool) error {
// try again with an .exe extension
newExec = newExec + ".exe"
if _, fallbackErr := os.Stat(newExec); fallbackErr != nil {
return fmt.Errorf("The executable in the extracted path is missing or it is inaccessible: %v, %v", err, fallbackErr)
return fmt.Errorf("the executable in the extracted path is missing or it is inaccessible: %v, %v", err, fallbackErr)
}
}
// rename the current executable
if err := os.Rename(oldExec, renamedOldExec); err != nil {
return fmt.Errorf("Failed to rename the current executable: %w", err)
return fmt.Errorf("failed to rename the current executable: %w", err)
}
tryToRevertExecChanges := func() {
@@ -227,7 +227,7 @@ func (p *plugin) update(withBackup bool) error {
// replace with the extracted binary
if err := os.Rename(newExec, oldExec); err != nil {
tryToRevertExecChanges()
return fmt.Errorf("Failed replacing the executable: %w", err)
return fmt.Errorf("failed replacing the executable: %w", err)
}
if withBackup {