MCPcopy Create free account
hub / github.com/Adembc/lazyssh / buildFileValidationError

Function buildFileValidationError

internal/adapters/ui/validation.go:381–394  ·  view source on GitHub ↗

buildFileValidationError builds an error message from invalid and inaccessible file paths

(invalidPaths, inaccessiblePaths []string)

Source from the content-addressed store, hash-verified

379
380// buildFileValidationError builds an error message from invalid and inaccessible file paths
381func buildFileValidationError(invalidPaths, inaccessiblePaths []string) error {
382 var errors []string
383 if len(invalidPaths) > 0 {
384 errors = append(errors, fmt.Sprintf("file(s) not found: %s", strings.Join(invalidPaths, ", ")))
385 }
386 if len(inaccessiblePaths) > 0 {
387 errors = append(errors, fmt.Sprintf("file(s) not accessible: %s", strings.Join(inaccessiblePaths, ", ")))
388 }
389
390 if len(errors) > 0 {
391 return fmt.Errorf("%s", strings.Join(errors, "; "))
392 }
393 return nil
394}
395
396// validateFilePaths validates multiple file paths with a custom separator
397func validateFilePaths(files string, separator string) error {

Callers 1

validateFilePathsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected