Skip to content

Commit

Permalink
Fixes spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
gdavison committed Oct 18, 2024
1 parent 95a64cc commit 80c5d90
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 4 additions & 0 deletions internal/generate/tagstests/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ func (d ResourceDatum) AdditionalTfVars() map[string]string {
})
}

func (d ResourceDatum) HasImportStateIDAttribute() bool {
return d.importStateIDAttribute != ""
}

func (d ResourceDatum) ImportStateIDAttribute() string {
return namesgen.ConstOrQuote(d.importStateIDAttribute)
}
Expand Down
12 changes: 6 additions & 6 deletions internal/generate/tagstests/resource_test.go.gtpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,28 @@ plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), know
{{ if gt (len .ImportStateID) 0 -}}
ImportStateId: {{ .ImportStateID }},
{{ end -}}
{{ if gt (len .ImportStateIDAttribute) 0 -}}
{{ if .HasImportStateIDAttribute -}}
ImportStateIdFunc: acctest.AttrImportStateIdFunc(resourceName, {{ .ImportStateIDAttribute }}),
{{ else if gt (len .ImportStateIDFunc) 0 -}}
ImportStateIdFunc: {{ .ImportStateIDFunc }}(resourceName),
{{ end -}}
ImportStateVerify: true,
{{ if gt (len .ImportStateIDAttribute) 0 -}}
{{ if .HasImportStateIDAttribute -}}
ImportStateVerifyIdentifierAttribute: {{ .ImportStateIDAttribute }},
{{ end }}
{{- end }}

{{ define "ImportBody" }}
{{ template "CommonImportBody" . }}
{{ if gt (len .ImportIgnore) 0 -}}
{{ template "CommonImportBody" . -}}
{{- if gt (len .ImportIgnore) 0 -}}
ImportStateVerifyIgnore: []string{
{{ range $i, $v := .ImportIgnore }}{{ $v }},{{ end }}
},
{{- end }}
{{ end }}

{{ define "ImportBodyIgnoreKey1" }}
{{ template "CommonImportBody" . }}
{{ template "CommonImportBody" . -}}
{{ if eq .Implementation "framework" -}}
ImportStateVerifyIgnore: []string{
acctest.CtTagsKey1, // The canonical value returned by the AWS API is ""
Expand All @@ -89,7 +89,7 @@ plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrTagsAll), know
{{ end }}

{{ define "ImportBodyIgnoreResourceKey1" }}
{{ template "CommonImportBody" . }}
{{ template "CommonImportBody" . -}}
{{ if eq .Implementation "framework" -}}
ImportStateVerifyIgnore: []string{
"tags.resourcekey1", // The canonical value returned by the AWS API is ""
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 80c5d90

Please sign in to comment.