This commit is contained in:
Philippe Caseiro 2022-06-30 09:50:37 +02:00
parent 5a75bc5a37
commit e47d2f64df
2 changed files with 1 additions and 2 deletions

1
go.mod
View File

@ -7,7 +7,6 @@ require (
github.com/gin-gonic/gin v1.8.1 github.com/gin-gonic/gin v1.8.1
github.com/hashicorp/hcl/v2 v2.11.1 github.com/hashicorp/hcl/v2 v2.11.1
github.com/imdario/mergo v0.3.13 github.com/imdario/mergo v0.3.13
github.com/mitchellh/mapstructure v1.5.0
github.com/zclconf/go-cty v1.10.0 github.com/zclconf/go-cty v1.10.0
gopkg.in/ini.v1 v1.66.6 gopkg.in/ini.v1 v1.66.6
) )

View File

@ -89,7 +89,7 @@ func processConfigFiles(tpls []ConfigFile, variables map[string]interface{}, tem
} else if fileExt == ".tpl" { } else if fileExt == ".tpl" {
tpl.TemplateType = "go" tpl.TemplateType = "go"
} else { } else {
return fmt.Errorf("Unsupported file extention %s, templates extensions have to be '.hcl' or '.tpl'", fileExt) return fmt.Errorf("Unsupported file type %s, templates extensions have to be '.hcl' or '.tpl'", fileExt)
} }
if err := tpl.Generate("/tmp/test", templateDir, values); err != nil { if err := tpl.Generate("/tmp/test", templateDir, values); err != nil {
return fmt.Errorf("Template %s generation failed with error %v", tpl.Source, err) return fmt.Errorf("Template %s generation failed with error %v", tpl.Source, err)