diff options
| author | Paul Buetow <paul@buetow.org> | 2026-07-06 23:56:32 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-07-06 23:56:32 +0300 |
| commit | 62ff4e782bc057d277a7c41fa35a665e2aeca045 (patch) | |
| tree | 5ca14104e68a9815f20ae6802c78341c6dc94371 /api/options | |
| parent | 5600bedb927e291e2e78e6140de256e1a1d4475c (diff) | |
initial package management
Diffstat (limited to 'api/options')
| -rw-r--r-- | api/options/option.go | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/api/options/option.go b/api/options/option.go index 1c757c4..fcffccd 100644 --- a/api/options/option.go +++ b/api/options/option.go @@ -96,27 +96,27 @@ func WithFileMode(mode os.FileMode) Option { // WithPrune enables reconciliation of extra destination entries during a // source copy, and recursive removal during IsAbsent(). -func WithPrune() Option { - return func(t any) { - r, ok := t.(Prunable) - if !ok { - log.Fatalf("%T does not support WithPrune", t) - } - r.SetPrune() +var WithPrune = func(t any) { + r, ok := t.(Prunable) + if !ok { + log.Fatalf("%T does not support WithPrune", t) } + r.SetPrune() } +func WithPruneFunc() Option { return WithPrune } + // IsAbsent marks the resource for removal. -func IsAbsent() Option { - return func(t any) { - r, ok := t.(Absentable) - if !ok { - log.Fatalf("%T does not support IsAbsent", t) - } - r.SetAbsent() +var IsAbsent = func(t any) { + r, ok := t.(Absentable) + if !ok { + log.Fatalf("%T does not support IsAbsent", t) } + r.SetAbsent() } +func IsAbsentFunc() Option { return IsAbsent } + // WithSymlink makes the resource a symbolic link pointing at target. func WithSymlink(target string) Option { return func(t any) { |
