()
| 51 | } |
| 52 | |
| 53 | func ExamplePipe_Basename() { |
| 54 | input := []string{ |
| 55 | "", |
| 56 | "/", |
| 57 | "/root", |
| 58 | "/tmp/example.php", |
| 59 | "/var/tmp/", |
| 60 | "./src/filters", |
| 61 | "C:\\Program Files", |
| 62 | } |
| 63 | script.Slice(input).Basename().Stdout() |
| 64 | // Output: |
| 65 | // . |
| 66 | // \ |
| 67 | // root |
| 68 | // example.php |
| 69 | // tmp |
| 70 | // filters |
| 71 | // Program Files |
| 72 | } |
| 73 | |
| 74 | func ExamplePipe_Dirname() { |
| 75 | input := []string{ |