MCPcopy Create free account
hub / github.com/otiai10/copy / ExampleOptions

Function ExampleOptions

example_test.go:21–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19}
20
21func ExampleOptions() {
22
23 err := Copy(
24 "test/data/example",
25 "test/data.copy/example_with_options",
26 Options{
27 Skip: func(info os.FileInfo, src, dest string) (bool, error) {
28 return strings.HasSuffix(src, ".git-like"), nil
29 },
30 OnSymlink: func(src string) SymlinkAction {
31 return Skip
32 },
33 PermissionControl: AddPermission(0200),
34 },
35 )
36 fmt.Println("Error:", err)
37 _, err = os.Stat("test/data.copy/example_with_options/.git-like")
38 fmt.Println("Skipped:", os.IsNotExist(err))
39
40 // Output:
41 // Error: <nil>
42 // Skipped: true
43
44}

Callers

nothing calls this directly

Calls 1

CopyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…