removeAppFromTargets removes a specific app from a comma-separated target list.
(targets, app string)
| 356 | |
| 357 | // removeAppFromTargets removes a specific app from a comma-separated target list. |
| 358 | func removeAppFromTargets(targets, app string) string { |
| 359 | if targets == "" { |
| 360 | return "" |
| 361 | } |
| 362 | parts := strings.Split(targets, ",") |
| 363 | result := make([]string, 0, len(parts)) |
| 364 | for _, p := range parts { |
| 365 | p = strings.TrimSpace(p) |
| 366 | if p != "" && p != app { |
| 367 | result = append(result, p) |
| 368 | } |
| 369 | } |
| 370 | return strings.Join(result, ",") |
| 371 | } |
| 372 | |
| 373 | func scanItems(rows *sql.Rows) ([]Item, error) { |
| 374 | items := []Item{} |