Skip to content

Commit 82377fd

Browse files
committed
fixup! Add type awareness to import block generating
staticcheck
1 parent 09e574a commit 82377fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

helper/resource/testing_new_import_state.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,13 @@ func appendImportBlockWithIdentity(config string, resourceName string, identityV
444444
resourceName)
445445

446446
for k, v := range identityValues {
447-
switch v.(type) {
447+
switch v := v.(type) {
448448
case bool:
449449
configBuilder += fmt.Sprintf(` %q = %t`+"\n", k, v)
450450

451451
case []any:
452452
var quotedV []string
453-
for _, v := range v.([]any) {
453+
for _, v := range v {
454454
quotedV = append(quotedV, fmt.Sprintf(`%q`, v))
455455
}
456456
configBuilder += fmt.Sprintf(` %q = [%s]`+"\n", k, strings.Join(quotedV, ", "))

0 commit comments

Comments
 (0)