Skip to content

Commit 48e9dcd

Browse files
committed
Fix unnecessary else blocks
1 parent 3e5654e commit 48e9dcd

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

iterative/resource_runner.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ func resourceRunnerCreate(ctx context.Context, d *schema.ResourceData, m interfa
200200
return resource.RetryableError(fmt.Errorf("Waiting for the machine to accept connections... %s", logError))
201201
} else if !utils.IsReady(logEvents) {
202202
return resource.RetryableError(fmt.Errorf("Waiting for the runner to be ready... %s", logError))
203-
} else {
204-
return nil
205203
}
204+
205+
return nil // The runner is ready.
206206
})
207207

208208
if logError != nil {

iterative/utils/ssh.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ func RunCommand(command string, timeout time.Duration, hostAddress string, userN
7676
session.Stdout = &buffer
7777
session.Stderr = &buffer
7878

79-
if err := session.Run(command); err == nil {
80-
return buffer.String(), err
81-
} else {
82-
return "", err
83-
}
79+
err = session.Run(command)
80+
return buffer.String(), err
8481
}

0 commit comments

Comments
 (0)