From 62ff4e782bc057d277a7c41fa35a665e2aeca045 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 6 Jul 2026 23:56:32 +0300 Subject: initial package management --- api/options/option.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'api/options') 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) { -- cgit v1.2.3