trimNonEmpty trims each element and drops the empties.
(in []string)
| 524 | |
| 525 | // trimNonEmpty trims each element and drops the empties. |
| 526 | func 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. |
no outgoing calls
no test coverage detected