PlanAvailable reports whether a plan with the given id is in the list.
(plans []dashboard.Plan, id string)
| 53 | |
| 54 | // PlanAvailable reports whether a plan with the given id is in the list. |
| 55 | func PlanAvailable(plans []dashboard.Plan, id string) bool { |
| 56 | for i := range plans { |
| 57 | if plans[i].ID == id { |
| 58 | return true |
| 59 | } |
| 60 | } |
| 61 | return false |
| 62 | } |
| 63 | |
| 64 | // PlanChoices returns the user-facing plan identifiers (the free plan is shown |
| 65 | // as "free" regardless of its underlying id). |