injectProjectColumn adds a "project" column after the first column if not already present.
(columns []string)
| 48 | |
| 49 | // injectProjectColumn adds a "project" column after the first column if not already present. |
| 50 | func injectProjectColumn(columns []string) []string { |
| 51 | for _, col := range columns { |
| 52 | if col == "project" { |
| 53 | return columns |
| 54 | } |
| 55 | } |
| 56 | insertIdx := 1 |
| 57 | if len(columns) < 2 { |
| 58 | insertIdx = len(columns) |
| 59 | } |
| 60 | result := make([]string, 0, len(columns)+1) |
| 61 | result = append(result, columns[:insertIdx]...) |
| 62 | result = append(result, "project") |
| 63 | result = append(result, columns[insertIdx:]...) |
| 64 | return result |
| 65 | } |
| 66 | |
| 67 | // scanProjectTasks scans a single project and returns its tasks with relative file paths. |
| 68 | func scanProjectTasks(entry GlobalProjectEntry) ([]*model.Task, error) { |
no outgoing calls
no test coverage detected