Skip to content

Commit

Permalink
add RevertOnErr option to remove broken files
Browse files Browse the repository at this point in the history
  • Loading branch information
emar-kar committed Jan 11, 2024
1 parent 05fd100 commit c8f38aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type options struct {
force bool
contentOnly bool
move bool
revert bool
}

func defaultOptions() *options {
Expand Down Expand Up @@ -37,3 +38,6 @@ func WithBufferSize(size int) optFunc {
o.bufSize = size
}
}

// RevertOnErr removes destination file if there was an error during copy process.
func RevertOnErr(o *options) { o.revert = true }

0 comments on commit c8f38aa

Please sign in to comment.