MCPcopy Create free account
hub / github.com/diillson/chatcli / trimNonEmpty

Function trimNonEmpty

cli/plugins/builtin_context.go:526–534  ·  view source on GitHub ↗

trimNonEmpty trims each element and drops the empties.

(in []string)

Source from the content-addressed store, hash-verified

524
525// trimNonEmpty trims each element and drops the empties.
526func trimNonEmpty(in []string) []string {
527 out := make([]string, 0, len(in))
528 for _, s := range in {
529 if t := strings.TrimSpace(s); t != "" {
530 out = append(out, t)
531 }
532 }
533 return out
534}
535
536// contextArgvToMap converts `--flag value`, `--flag=value` and bare positional
537// names into the raw map the JSON path produces.

Callers 1

contextStringSliceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected