Skip to content

Commit

Permalink
Update comments and test suites
Browse files Browse the repository at this point in the history
  • Loading branch information
relusc committed Jul 25, 2021
1 parent e2c2e2f commit 71cf5fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/files/files_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ func TestPathContainsTerraformStateOrVars(t *testing.T) {
{"contains tfvars", "./folder/terraform.tfvars", true},
{"contains tfvars.json", "./folder/hello/terraform.tfvars.json", true},
{"contains state", "./folder/hello/helloagain/terraform.tfstate", true},
{"contains state backup", "./folder/pewpew/terraform.tfstate.backup", true},
{"does not contain any", "./folder/pewpew/terraform.json", false},
{"contains state backup", "./folder/hey/terraform.tfstate.backup", true},
{"does not contain any", "./folder/salut/terraform.json", false},
}

for _, tt := range data {
Expand Down
2 changes: 1 addition & 1 deletion modules/terraform/var-file.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func GetAllVariablesFromVarFileE(t testing.TestingT, fileName string, out interf
return parseAndDecodeVarFile(string(fileContents), fileName, out)
}

// parseAndDecodeVarFile uses the HCL2 parser to parse the given varfile string into an HCL file body, and then decode it
// parseAndDecodeVarFile uses the HCL2 parser to parse the given varfile string into an HCL or HCL JSON file body, and then decode it
// into a map that maps var names to values.
func parseAndDecodeVarFile(fileContents string, filename string, out interface{}) (err error) {
// The HCL2 parser and especially cty conversions will panic in many types of errors, so we have to recover from
Expand Down

0 comments on commit 71cf5fd

Please sign in to comment.