displayFeatures will return a table displaying all features passed in. filterColumns must be a subset of the feature fields and will determine which columns to display
(filterColumns []string, features map[codersdk.FeatureName]codersdk.Feature)
| 114 | // filterColumns must be a subset of the feature fields and will determine which |
| 115 | // columns to display |
| 116 | func displayFeatures(filterColumns []string, features map[codersdk.FeatureName]codersdk.Feature) (string, error) { |
| 117 | rows := make([]featureRow, 0, len(features)) |
| 118 | for name, feat := range features { |
| 119 | rows = append(rows, featureRow{ |
| 120 | Name: name, |
| 121 | Entitlement: string(feat.Entitlement), |
| 122 | Enabled: feat.Enabled, |
| 123 | Limit: feat.Limit, |
| 124 | Actual: feat.Actual, |
| 125 | }) |
| 126 | } |
| 127 | |
| 128 | return cliui.DisplayTable(rows, "name", filterColumns) |
| 129 | } |
no test coverage detected