forbid transformations that add/remove path separators
(s string)
| 306 | |
| 307 | // forbid transformations that add/remove path separators |
| 308 | func validateSegment(s string) error { |
| 309 | if strings.TrimSpace(s) == "" { |
| 310 | return errors.New("transform cannot render path segments empty") |
| 311 | } |
| 312 | if strings.ContainsRune(s, '/') { |
| 313 | return fmt.Errorf("transform cannot add path separators: %v", s) |
| 314 | } |
| 315 | return nil |
| 316 | } |
| 317 | |
| 318 | // ParseGlobs determines whether a string contains {brackets} |
| 319 | // and returns the substring (including both brackets) for replacing |
no test coverage detected
searching dependent graphs…