MCPcopy Index your code
hub / github.com/rclone/rclone / validateSegment

Function validateSegment

lib/transform/transform.go:308–316  ·  view source on GitHub ↗

forbid transformations that add/remove path separators

(s string)

Source from the content-addressed store, hash-verified

306
307// forbid transformations that add/remove path separators
308func 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

Callers 1

transformPathFunction · 0.85

Calls 1

ErrorfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…