Skip to content

Commit

Permalink
Combined some if err check statements
Browse files Browse the repository at this point in the history
  • Loading branch information
lflare committed Jan 9, 2022
1 parent bdb05f6 commit 6df1ba4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,12 @@ func Rewrite(path string, info os.FileInfo, err error) error {
}

// Force filesystem sync
err = file.Sync()
if err != nil {
if err := file.Sync(); err != nil {
return fmt.Errorf("failed to sync: %v", err)
}

// Finish progress bar
err = bar.Finish()
if err != nil {
if err := bar.Finish(); err != nil {
panic(err) // Really shouldn't ever reach this point
}
}
Expand Down

0 comments on commit 6df1ba4

Please sign in to comment.