Skip to content

Commit 3b79895

Browse files
committed
lint
1 parent 91c046a commit 3b79895

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

helper/resource/testing_new_import_state.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func testStepNewImportState(ctx context.Context, t testing.T, helper *plugintest
176176
if kind.plannable() {
177177
return testImportBlock(ctx, t, workingDir, providers, resourceName, step, priorIdentityValues)
178178
} else {
179-
return testImportCommand(ctx, t, err, workingDir, providers, resourceName, importId, step, state)
179+
return testImportCommand(ctx, t, workingDir, providers, resourceName, importId, step, state)
180180
}
181181
}
182182

@@ -255,18 +255,15 @@ func verifyIdentityValues(ctx context.Context, t testing.T, workingDir *pluginte
255255
return nil
256256
}
257257

258-
func testImportCommand(ctx context.Context, t testing.T, err error, workingDir *plugintest.WorkingDir, providers *providerFactories, resourceName string, importId string, step TestStep, state *terraform.State) error {
259-
// TODO: extract to a function -- this is an implicit `else` for the long `if` above :)
260-
261-
var importState *terraform.State
262-
263-
err = runProviderCommand(ctx, t, workingDir, providers, func() error {
258+
func testImportCommand(ctx context.Context, t testing.T, workingDir *plugintest.WorkingDir, providers *providerFactories, resourceName string, importId string, step TestStep, state *terraform.State) error {
259+
err := runProviderCommand(ctx, t, workingDir, providers, func() error {
264260
return workingDir.Import(ctx, resourceName, importId)
265261
})
266262
if err != nil {
267263
return err
268264
}
269265

266+
var importState *terraform.State
270267
err = runProviderCommand(ctx, t, workingDir, providers, func() error {
271268
_, importState, err = getState(ctx, t, workingDir)
272269
if err != nil {

0 commit comments

Comments
 (0)