-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from jxsl13/chore/cleanup
use option pattern with variadic args for constructors
- Loading branch information
Showing
3 changed files
with
55 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package backupfs | ||
|
||
type backupFSOptions struct { | ||
allowWindowsVolumePaths bool | ||
} | ||
|
||
// WithVolumePaths, contrary to the normal BackupFS, this variant allows | ||
// to use absolute windows paths (C:\A\B\C instead of \A\B\C) when set to true. | ||
func WithVolumePaths(allow bool) BackupFSOption { | ||
return func(bf *backupFSOptions) { | ||
bf.allowWindowsVolumePaths = allow | ||
} | ||
} |