Skip to content

Commit e53dc03

Browse files
committed
fix linter errors
1 parent a795442 commit e53dc03

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

helper_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,9 +1251,8 @@ func applyableStatuses(r *Run) []RunStatus {
12511251
}
12521252
} else if r.CostEstimate != nil {
12531253
return []RunStatus{RunCostEstimated}
1254-
} else {
1255-
return []RunStatus{RunPlanned}
12561254
}
1255+
return []RunStatus{RunPlanned}
12571256
}
12581257

12591258
// pollRunStatus will poll the given run until its status matches one of the given run statuses or the given context

internal_run_task.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,22 @@ func (irt internalRunTask) ToRunTask() *RunTask {
4343
obj.WorkspaceRunTasks = workspaceTasks
4444

4545
// Check if the global configuration exists
46-
if val, ok := irt.RawGlobal["enabled"]; !ok {
46+
val, ok := irt.RawGlobal["enabled"]
47+
if !ok {
4748
// The enabled property is required so we can assume now that the
4849
// global configuration was not supplied
4950
return &obj
50-
} else if boolVal, ok := val.(bool); !ok {
51+
}
52+
53+
boolVal, ok := val.(bool)
54+
if !ok {
5155
// The enabled property exists but it is invalid (Couldn't cast to boolean)
5256
// so assume the global configuration was not supplied
5357
return &obj
54-
} else {
55-
obj.Global = &GlobalRunTask{
56-
Enabled: boolVal,
57-
}
58+
}
59+
60+
obj.Global = &GlobalRunTask{
61+
Enabled: boolVal,
5862
}
5963

6064
// Global Enforcement Level

run_task_integration_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ import (
1515

1616
func hasGlobalRunTasks(client *Client, organizationName string) (bool, error) {
1717
ctx := context.Background()
18-
if orgEntitlements, err := client.Organizations.ReadEntitlements(ctx, organizationName); err != nil {
18+
orgEntitlements, err := client.Organizations.ReadEntitlements(ctx, organizationName)
19+
if err != nil {
1920
return false, err
2021
} else if orgEntitlements == nil {
2122
return false, errors.New("The organization entitlements are empty.")
22-
} else {
23-
return orgEntitlements.GlobalRunTasks, nil
2423
}
24+
return orgEntitlements.GlobalRunTasks, nil
2525
}
2626

2727
func TestRunTasksCreate(t *testing.T) {

0 commit comments

Comments
 (0)