ResolvePaths splits a comma-separated list of paths and resolves each entry independently. Empty entries and entries that resolve to empty strings are skipped.
(raw, baseDir string)
| 41 | // resolves each entry independently. Empty entries and entries |
| 42 | // that resolve to empty strings are skipped. |
| 43 | func ResolvePaths(raw, baseDir string) []string { |
| 44 | if strings.TrimSpace(raw) == "" { |
| 45 | return nil |
| 46 | } |
| 47 | parts := strings.Split(raw, ",") |
| 48 | out := make([]string, 0, len(parts)) |
| 49 | for _, p := range parts { |
| 50 | if resolved := ResolvePath(p, baseDir); resolved != "" { |
| 51 | out = append(out, resolved) |
| 52 | } |
| 53 | } |
| 54 | return out |
| 55 | } |