MCPcopy Create free account
hub / github.com/compozy/agh / validateAbsolutePathsInternal

Function validateAbsolutePathsInternal

internal/api/core/session_workspace.go:107–118  ·  view source on GitHub ↗

ValidateAbsolutePaths ensures every populated entry in a list is absolute.

(prefix string, field string, values []string)

Source from the content-addressed store, hash-verified

105
106// ValidateAbsolutePaths ensures every populated entry in a list is absolute.
107func validateAbsolutePathsInternal(prefix string, field string, values []string) error {
108 for _, value := range values {
109 trimmed := strings.TrimSpace(value)
110 if trimmed == "" {
111 continue
112 }
113 if !filepath.IsAbs(trimmed) {
114 return prefixedError(prefix, field+" entries must be absolute paths")
115 }
116 }
117 return nil
118}
119
120// TrimStringSlice trims all entries while preserving order and cardinality.
121func trimStringSliceInternal(values []string) []string {

Callers 3

CreateWorkspaceMethod · 0.85
UpdateWorkspaceMethod · 0.85

Calls 1

prefixedErrorFunction · 0.85

Tested by 1