diff options
| author | Paul Buetow <paul@buetow.org> | 2026-07-05 00:12:12 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-07-05 00:12:12 +0300 |
| commit | a1250c11b04b8ad0a713d801942aa3208b6a43de (patch) | |
| tree | dcf3ae6d0074052efe21e3461911b768a91e25c8 /examples/examples.go | |
| parent | 8228ba742f6b23a93e6a00006feba29225ea89c7 (diff) | |
add aliases
Diffstat (limited to 'examples/examples.go')
| -rw-r--r-- | examples/examples.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/examples.go b/examples/examples.go index 3fe2d50..6b97ab3 100644 --- a/examples/examples.go +++ b/examples/examples.go @@ -33,6 +33,7 @@ func Run() error { // 7. Ensuring something is absent file.Have("/tmp/gonf_old.txt", file.IsAbsent()) + file.Absent("/tmp/gonf_old.txt") // Alternative way // 8. A directory tree copied from source, reconciled, with a distinct // file mode from the directory's own mode @@ -49,6 +50,7 @@ func Run() error { // something real to demonstrate. _ = os.MkdirAll("/tmp/gonf_stale_dir/nested", 0o755) dir.Have("/tmp/gonf_stale_dir", dir.IsAbsent(), dir.WithPrune()) + dir.Absent("/tmp/gonf_stale_dir", dir.WithPrune()) // Alternative way // 10. Non-recursively removing an empty directory _ = os.Mkdir("/tmp/gonf_stale_empty_dir", 0o755) @@ -57,6 +59,7 @@ func Run() error { // 11. Ensuring a symlink is absent _ = os.Symlink("/tmp/gonf_hello.txt", "/tmp/gonf_stale_link") link.Have("/tmp/gonf_stale_link", link.IsAbsent()) + link.Absent("/tmp/gonf_stale_link") // Alternative way // 12. Ensuring a hardlink is absent _ = os.Link("/tmp/gonf_hello.txt", "/tmp/gonf_stale_hardlink") |
