daysMap returns a map of the days of the week that are specified in the bitmap.
(daysOfWeek uint8)
| 75 | // daysMap returns a map of the days of the week that are specified in the |
| 76 | // bitmap. |
| 77 | func daysMap(daysOfWeek uint8) map[time.Weekday]bool { |
| 78 | days := make(map[time.Weekday]bool) |
| 79 | for i, day := range DaysOfWeek { |
| 80 | // #nosec G115 - Safe conversion, i ranges from 0-6 for days of the week |
| 81 | days[day] = daysOfWeek&(1<<uint(i)) != 0 |
| 82 | } |
| 83 | return days |
| 84 | } |
| 85 | |
| 86 | // VerifyTemplateAutostopRequirement returns an error if the autostop |
| 87 | // requirement is invalid. |