@@ -10,13 +10,13 @@ import (
10
10
var tmpl = template .New ("" ).Option ("missingkey=error" )
11
11
var ghActionsTmpl = template .New ("" ).Option ("missingkey=error" ).Delims ("[[" , "]]" )
12
12
13
- func ExecuteWithFuncs (filePaths []string , data map [string ]interface {}, funcMap template.FuncMap ) error {
13
+ func ExecuteWithFuncs (filePaths []* string , data map [string ]interface {}, funcMap template.FuncMap ) error {
14
14
for _ , filePathName := range filePaths {
15
15
// template code
16
- parsedTemplates := template .Must (tmpl .ParseFiles (filePathName )).Funcs (funcMap )
16
+ parsedTemplates := template .Must (tmpl .ParseFiles (* filePathName )).Funcs (funcMap )
17
17
// generate go code now
18
- fileName := filePathName [strings .LastIndex (filePathName , utils .SubstrString )+ 1 :]
19
- createdFile , err := os .Create (strings .TrimSuffix (filePathName , utils .TemplateExtension ))
18
+ fileName := ( * filePathName ) [strings .LastIndex (* filePathName , utils .SubstrString )+ 1 :]
19
+ createdFile , err := os .Create (strings .TrimSuffix (* filePathName , utils .TemplateExtension ))
20
20
if err != nil {
21
21
return err
22
22
}
@@ -27,8 +27,8 @@ func ExecuteWithFuncs(filePaths []string, data map[string]interface{}, funcMap t
27
27
28
28
// delete the template files
29
29
for _ , filePathName := range filePaths {
30
- if strings .HasSuffix (filePathName , ".tmpl" ) {
31
- if err := os .Remove (filePathName ); err != nil {
30
+ if strings .HasSuffix (* filePathName , ".tmpl" ) {
31
+ if err := os .Remove (* filePathName ); err != nil {
32
32
return err
33
33
}
34
34
}
0 commit comments