parseUsers parses the CRONITOR_USERS config value into a slice of usernames
()
| 459 | |
| 460 | // parseUsers parses the CRONITOR_USERS config value into a slice of usernames |
| 461 | func parseUsers() []string { |
| 462 | usersConfig := viper.GetString(varUsers) |
| 463 | if usersConfig == "" { |
| 464 | return []string{} // Return empty slice for default behavior |
| 465 | } |
| 466 | |
| 467 | // Split by comma and clean up each username |
| 468 | users := strings.Split(usersConfig, ",") |
| 469 | var cleanUsers []string |
| 470 | for _, user := range users { |
| 471 | user = strings.TrimSpace(user) |
| 472 | if user != "" { |
| 473 | cleanUsers = append(cleanUsers, user) |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | return cleanUsers |
| 478 | } |
no outgoing calls
no test coverage detected