-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add OnSymlink options: Shallow/Deep/Skip
- Loading branch information
Showing
4 changed files
with
89 additions
and
43 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,26 @@ | ||
package copy | ||
|
||
// Options specifies optional actions on copying. | ||
type Options struct { | ||
// OnSymlink can specify what to do on symlink | ||
OnSymlink func(p string) SymlinkAction | ||
} | ||
|
||
// SymlinkAction represents what to do on symlink. | ||
type SymlinkAction int | ||
|
||
const ( | ||
// Deep creates hard-copy of contents. | ||
Deep SymlinkAction = iota | ||
// Shallow creates new symlink to the dest of symlink. | ||
Shallow | ||
// Skip does nothing with symlink. | ||
Skip | ||
) | ||
|
||
// DefaultOptions by default. | ||
var DefaultOptions = Options{ | ||
OnSymlink: func(string) SymlinkAction { | ||
return Shallow | ||
}, | ||
} |
This file was deleted.
Oops, something went wrong.