Try 07
This commit is contained in:
parent
5a75bc5a37
commit
e47d2f64df
1
go.mod
1
go.mod
|
@ -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
|
||||||
)
|
)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue