@@ -8,9 +8,10 @@ import (
88 "fmt"
99 "testing"
1010
11+ "gopkg.in/yaml.v3"
12+
1113 "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/config"
1214 "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer"
13- "gopkg.in/yaml.v3"
1415
1516 "github.com/google/go-cmp/cmp"
1617 "github.com/google/go-cmp/cmp/cmpopts"
@@ -321,13 +322,12 @@ func Test_ConfigExplorer_FindResources(t *testing.T) {
321322 }
322323
323324 for name , testCase := range testCases {
324- name , testCase := name , testCase
325325
326326 t .Run (name , func (t * testing.T ) {
327327 t .Parallel ()
328328
329- explorer := explorer .NewConfigExplorer (high.Document {Paths : & high.Paths {PathItems : testCase .pathItems }}, testCase .config )
330- got , err := explorer .FindResources ()
329+ configExplorer := explorer .NewConfigExplorer (high.Document {Paths : & high.Paths {PathItems : testCase .pathItems }}, testCase .config )
330+ got , err := configExplorer .FindResources ()
331331
332332 if testCase .expectedErr != nil {
333333 if err == nil {
@@ -515,13 +515,12 @@ func Test_ConfigExplorer_FindDataSources(t *testing.T) {
515515 }
516516
517517 for name , testCase := range testCases {
518- name , testCase := name , testCase
519518
520519 t .Run (name , func (t * testing.T ) {
521520 t .Parallel ()
522521
523- explorer := explorer .NewConfigExplorer (high.Document {Paths : & high.Paths {PathItems : testCase .pathItems }}, testCase .config )
524- got , err := explorer .FindDataSources ()
522+ configExplorer := explorer .NewConfigExplorer (high.Document {Paths : & high.Paths {PathItems : testCase .pathItems }}, testCase .config )
523+ got , err := configExplorer .FindDataSources ()
525524
526525 if testCase .expectedErr != nil {
527526 if err == nil {
@@ -576,7 +575,6 @@ func Test_ConfigExplorer_FindProvider(t *testing.T) {
576575 }
577576
578577 for name , testCase := range testCases {
579- name , testCase := name , testCase
580578
581579 t .Run (name , func (t * testing.T ) {
582580 t .Parallel ()
@@ -586,8 +584,8 @@ func Test_ConfigExplorer_FindProvider(t *testing.T) {
586584 t .Fatal (err )
587585 }
588586
589- explorer := explorer .NewConfigExplorer (oasModel , testCase .config )
590- got , err := explorer .FindProvider ()
587+ configExplorer := explorer .NewConfigExplorer (oasModel , testCase .config )
588+ got , err := configExplorer .FindProvider ()
591589
592590 if err != nil {
593591 t .Fatalf ("was not expecting error, got: %s" , err )
0 commit comments