()
| 19 | } |
| 20 | |
| 21 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…