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

Function trimmedUniqueStrings

internal/cli/workspace.go:635–650  ·  view source on GitHub ↗
(values []string)

Source from the content-addressed store, hash-verified

633}
634
635func trimmedUniqueStrings(values []string) []string {
636 out := make([]string, 0, len(values))
637 seen := make(map[string]struct{}, len(values))
638 for _, value := range values {
639 trimmed := strings.TrimSpace(value)
640 if trimmed == "" {
641 continue
642 }
643 if _, exists := seen[trimmed]; exists {
644 continue
645 }
646 seen[trimmed] = struct{}{}
647 out = append(out, trimmed)
648 }
649 return out
650}

Callers 2

newWorkspaceAddCommandFunction · 0.85
mergeWorkspaceAddDirsFunction · 0.85

Calls 1

appendFunction · 0.85

Tested by

no test coverage detected