use errors.Fatalf instead of custom formatting

This commit is contained in:
Michael Eischer
2025-09-24 22:11:54 +02:00
parent 97933d1404
commit d491c1bdbf
2 changed files with 2 additions and 2 deletions

View File

@@ -171,7 +171,7 @@ func (opts *GlobalOptions) PreRun(needsPassword bool) error {
}
pwd, err := resolvePassword(opts, "RESTIC_PASSWORD")
if err != nil {
return errors.Fatal(fmt.Sprintf("Resolving password failed: %v\n", err))
return errors.Fatalf("Resolving password failed: %v", err)
}
opts.password = pwd
return nil

View File

@@ -87,7 +87,7 @@ func (fp *CommandReader) wait() error {
err := fp.cmd.Wait()
if err != nil {
// Use a fatal error to abort the snapshot.
return errors.Fatal(fmt.Errorf("command failed: %w", err).Error())
return errors.Fatalf("command failed: %v", err)
}
return nil
}