Skip to content

Commit

Permalink
fix lints - do error checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
nat-henderson committed Dec 15, 2021
1 parent d654be6 commit ee34e13
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,17 @@ func dataSourceGoogleContainerAwsVersionsRead(d *schema.ResourceData, meta inter
if err != nil {
return err
}
d.Set("supported_regions", res["supportedAwsRegions"])
if err := d.Set("supported_regions", res["supportedAwsRegions"]); err != nil {
return err
}
var validVersions []string
for _, v := range res["validVersions"].([]interface{}) {
vm := v.(map[string]interface{})
validVersions = append(validVersions, vm["version"].(string))
}
d.Set("valid_versions", validVersions)
if err := d.Set("valid_versions", validVersions); err != nil {
return err
}

d.SetId(time.Now().UTC().String())
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,17 @@ func dataSourceGoogleContainerAzureVersionsRead(d *schema.ResourceData, meta int
if err != nil {
return err
}
d.Set("supported_regions", res["supportedAzureRegions"])
if err := d.Set("supported_regions", res["supportedAzureRegions"]); err != nil {
return err
}
var validVersions []string
for _, v := range res["validVersions"].([]interface{}) {
vm := v.(map[string]interface{})
validVersions = append(validVersions, vm["version"].(string))
}
d.Set("valid_versions", validVersions)
if err := d.Set("valid_versions", validVersions); err != nil {
return err
}

d.SetId(time.Now().UTC().String())
return nil
Expand Down
2 changes: 2 additions & 0 deletions mmv1/third_party/terraform/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1463,3 +1463,5 @@ github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-202112
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211214175538-23aaa3b3a636/go.mod h1:oEeBHikdF/NrnUy0ornVaY1OT+jGvTqm+LQS0+ZDKzU=
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211214175538-23aaa3b3a636 h1:91BjCMjMOZc+qBIkXxj2RU0dznJx/ySUL1HBJ5i+YRs=
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211214175538-23aaa3b3a636/go.mod h1:oEeBHikdF/NrnUy0ornVaY1OT+jGvTqm+LQS0+ZDKzU=
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211214175538-23aaa3b3a636 h1:91BjCMjMOZc+qBIkXxj2RU0dznJx/ySUL1HBJ5i+YRs=
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211214175538-23aaa3b3a636/go.mod h1:oEeBHikdF/NrnUy0ornVaY1OT+jGvTqm+LQS0+ZDKzU=

0 comments on commit ee34e13

Please sign in to comment.