Skip to content

Commit ef707cf

Browse files
committed
linting
1 parent 20aa6b4 commit ef707cf

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

codersdk/deployment.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ type Feature struct {
180180
}
181181

182182
// Compare compares two features and returns an integer representing
183-
// if the first feature (a) is greater than, equal to, or less than the second
183+
// if the first feature (f) is greater than, equal to, or less than the second
184184
// feature (b). "Greater than" means the first feature has more functionality
185185
// than the second feature. It is assumed the features are for the same FeatureName.
186186
//
@@ -190,59 +190,59 @@ type Feature struct {
190190
// 3. The limit is greater
191191
// 4. Enabled is greater than disabled
192192
// 5. The actual is greater
193-
func (a Feature) Compare(b Feature) int {
194-
if !a.Capable() || !b.Capable() {
193+
func (f Feature) Compare(b Feature) int {
194+
if !f.Capable() || !b.Capable() {
195195
// If either is incapable, then it is possible a grace period
196196
// feature can be "greater" than an entitled.
197197
// If either is "NotEntitled" then we can defer to a strict entitlement
198198
// check.
199-
if a.Entitlement.Weight() >= 0 && b.Entitlement.Weight() >= 0 {
200-
if a.Capable() && !b.Capable() {
199+
if f.Entitlement.Weight() >= 0 && b.Entitlement.Weight() >= 0 {
200+
if f.Capable() && !b.Capable() {
201201
return 1
202202
}
203-
if b.Capable() && !a.Capable() {
203+
if b.Capable() && !f.Capable() {
204204
return -1
205205
}
206206
}
207207
}
208208

209209
// Strict entitlement check. Higher is better
210-
entitlementDifference := a.Entitlement.Weight() - b.Entitlement.Weight()
210+
entitlementDifference := f.Entitlement.Weight() - b.Entitlement.Weight()
211211
if entitlementDifference != 0 {
212212
return entitlementDifference
213213
}
214214

215215
// If the entitlement is the same, then we can compare the limits.
216-
if a.Limit == nil && b.Limit != nil {
216+
if f.Limit == nil && b.Limit != nil {
217217
return -1
218218
}
219-
if a.Limit != nil && b.Limit == nil {
219+
if f.Limit != nil && b.Limit == nil {
220220
return 1
221221
}
222-
if a.Limit != nil && b.Limit != nil {
223-
difference := *a.Limit - *b.Limit
222+
if f.Limit != nil && b.Limit != nil {
223+
difference := *f.Limit - *b.Limit
224224
if difference != 0 {
225225
return int(difference)
226226
}
227227
}
228228

229229
// Enabled is better than disabled.
230-
if a.Enabled && !b.Enabled {
230+
if f.Enabled && !b.Enabled {
231231
return 1
232232
}
233-
if !a.Enabled && b.Enabled {
233+
if !f.Enabled && b.Enabled {
234234
return -1
235235
}
236236

237237
// Higher actual is better
238-
if a.Actual == nil && b.Actual != nil {
238+
if f.Actual == nil && b.Actual != nil {
239239
return -1
240240
}
241-
if a.Actual != nil && b.Actual == nil {
241+
if f.Actual != nil && b.Actual == nil {
242242
return 1
243243
}
244-
if a.Actual != nil && b.Actual != nil {
245-
difference := *a.Actual - *b.Actual
244+
if f.Actual != nil && b.Actual != nil {
245+
difference := *f.Actual - *b.Actual
246246
if difference != 0 {
247247
return int(difference)
248248
}

0 commit comments

Comments
 (0)