Use a switch statement in policy.Boolean
@@ -18,15 +18,10 @@ const (
type Policy string
func Boolean(policy Policy) bool {
- for _, p := range []Policy{
- Locked,
- Automated,
- Ignore,
- } {
- if policy == p {
+ switch policy {
+ case Locked, Automated, Ignore:
return true
}
- }
return false
}
