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

Function validateAbsolutePathInternal

internal/api/core/session_workspace.go:95–104  ·  view source on GitHub ↗

ValidateAbsolutePath ensures a field carries an absolute filesystem path.

(prefix string, field string, value string)

Source from the content-addressed store, hash-verified

93
94// ValidateAbsolutePath ensures a field carries an absolute filesystem path.
95func validateAbsolutePathInternal(prefix string, field string, value string) error {
96 trimmed := strings.TrimSpace(value)
97 if trimmed == "" {
98 return prefixedError(prefix, field+" is required")
99 }
100 if !filepath.IsAbs(trimmed) {
101 return prefixedError(prefix, field+" must be an absolute path")
102 }
103 return nil
104}
105
106// ValidateAbsolutePaths ensures every populated entry in a list is absolute.
107func validateAbsolutePathsInternal(prefix string, field string, values []string) error {

Callers 4

CreateWorkspaceMethod · 0.85
ResolveWorkspaceMethod · 0.85

Calls 1

prefixedErrorFunction · 0.85

Tested by 1