()
| 168 | } |
| 169 | |
| 170 | func ExamplePipe_Basename() { |
| 171 | input := []string{ |
| 172 | "", |
| 173 | "/", |
| 174 | "/root", |
| 175 | "/tmp/example.php", |
| 176 | "/var/tmp/", |
| 177 | "./src/filters", |
| 178 | "C:/Program Files", |
| 179 | } |
| 180 | script.Slice(input).Basename().Stdout() |
| 181 | // Output: |
| 182 | // . |
| 183 | // / |
| 184 | // root |
| 185 | // example.php |
| 186 | // tmp |
| 187 | // filters |
| 188 | // Program Files |
| 189 | } |
| 190 | |
| 191 | func ExamplePipe_Dirname() { |
| 192 | input := []string{ |