mirror of
https://github.com/restic/restic.git
synced 2026-05-19 16:45:24 +00:00
remove trailing newlines from errors.Fatalf calls
This commit is contained in:
@@ -502,7 +502,7 @@ func runBackup(ctx context.Context, opts BackupOptions, gopts GlobalOptions, ter
|
||||
if opts.TimeStamp != "" {
|
||||
timeStamp, err = time.ParseInLocation(TimeFormat, opts.TimeStamp, time.Local)
|
||||
if err != nil {
|
||||
return errors.Fatalf("error in time option: %v\n", err)
|
||||
return errors.Fatalf("error in time option: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ func runCat(ctx context.Context, gopts GlobalOptions, args []string, term ui.Ter
|
||||
case "snapshot":
|
||||
sn, _, err := restic.FindSnapshot(ctx, repo, repo, args[1])
|
||||
if err != nil {
|
||||
return errors.Fatalf("could not find snapshot: %v\n", err)
|
||||
return errors.Fatalf("could not find snapshot: %v", err)
|
||||
}
|
||||
|
||||
buf, err := json.MarshalIndent(sn, "", " ")
|
||||
@@ -195,7 +195,7 @@ func runCat(ctx context.Context, gopts GlobalOptions, args []string, term ui.Ter
|
||||
case "tree":
|
||||
sn, subfolder, err := restic.FindSnapshot(ctx, repo, repo, args[1])
|
||||
if err != nil {
|
||||
return errors.Fatalf("could not find snapshot: %v\n", err)
|
||||
return errors.Fatalf("could not find snapshot: %v", err)
|
||||
}
|
||||
|
||||
bar := newIndexTerminalProgress(printer)
|
||||
|
||||
@@ -102,7 +102,7 @@ func runInit(ctx context.Context, opts InitOptions, gopts GlobalOptions, args []
|
||||
|
||||
be, err := create(ctx, gopts.Repo, gopts, gopts.extended, printer)
|
||||
if err != nil {
|
||||
return errors.Fatalf("create repository at %s failed: %v\n", location.StripPassword(gopts.backends, gopts.Repo), err)
|
||||
return errors.Fatalf("create repository at %s failed: %v", location.StripPassword(gopts.backends, gopts.Repo), err)
|
||||
}
|
||||
|
||||
s, err := repository.New(be, repository.Options{
|
||||
@@ -115,7 +115,7 @@ func runInit(ctx context.Context, opts InitOptions, gopts GlobalOptions, args []
|
||||
|
||||
err = s.Init(ctx, version, gopts.password, chunkerPolynomial)
|
||||
if err != nil {
|
||||
return errors.Fatalf("create key in repository at %s failed: %v\n", location.StripPassword(gopts.backends, gopts.Repo), err)
|
||||
return errors.Fatalf("create key in repository at %s failed: %v", location.StripPassword(gopts.backends, gopts.Repo), err)
|
||||
}
|
||||
|
||||
if !gopts.JSON {
|
||||
|
||||
@@ -79,7 +79,7 @@ func addKey(ctx context.Context, repo *repository.Repository, gopts GlobalOption
|
||||
|
||||
id, err := repository.AddKey(ctx, repo, pw, opts.Username, opts.Hostname, repo.Key())
|
||||
if err != nil {
|
||||
return errors.Fatalf("creating new key failed: %v\n", err)
|
||||
return errors.Fatalf("creating new key failed: %v", err)
|
||||
}
|
||||
|
||||
err = switchToNewKeyAndRemoveIfBroken(ctx, repo, id, pw)
|
||||
|
||||
@@ -74,7 +74,7 @@ func changePassword(ctx context.Context, repo *repository.Repository, gopts Glob
|
||||
|
||||
id, err := repository.AddKey(ctx, repo, pw, "", "", repo.Key())
|
||||
if err != nil {
|
||||
return errors.Fatalf("creating new key failed: %v\n", err)
|
||||
return errors.Fatalf("creating new key failed: %v", err)
|
||||
}
|
||||
oldID := repo.KeyID()
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ func runRestore(ctx context.Context, opts RestoreOptions, gopts GlobalOptions,
|
||||
progress.Finish()
|
||||
|
||||
if totalErrors > 0 {
|
||||
return errors.Fatalf("There were %d errors\n", totalErrors)
|
||||
return errors.Fatalf("There were %d errors", totalErrors)
|
||||
}
|
||||
|
||||
if opts.Verify {
|
||||
@@ -266,7 +266,7 @@ func runRestore(ctx context.Context, opts RestoreOptions, gopts GlobalOptions,
|
||||
return err
|
||||
}
|
||||
if totalErrors > 0 {
|
||||
return errors.Fatalf("There were %d errors\n", totalErrors)
|
||||
return errors.Fatalf("There were %d errors", totalErrors)
|
||||
}
|
||||
|
||||
if !gopts.JSON {
|
||||
|
||||
@@ -93,7 +93,7 @@ func (sma snapshotMetadataArgs) convert() (*snapshotMetadata, error) {
|
||||
if sma.Time != "" {
|
||||
t, err := time.ParseInLocation(TimeFormat, sma.Time, time.Local)
|
||||
if err != nil {
|
||||
return nil, errors.Fatalf("error in time option: %v\n", err)
|
||||
return nil, errors.Fatalf("error in time option: %v", err)
|
||||
}
|
||||
timeStamp = &t
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user