mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-19 14:43:05 -03:00
write a canonical header for machine-generated files
Signed-off-by: Denys Smirnov <denys@sourced.tech>
This commit is contained in:
committed by
Denys Smirnov
parent
40a21f8e0b
commit
7eafe024af
@ -81,14 +81,7 @@ func buildLanguageExtensionsMap(languages map[string]*languageInfo) map[string][
|
||||
|
||||
func executeExtensionsTemplate(out io.Writer, extInfo *extensionsInfo, tmplPath, tmplName, commit string) error {
|
||||
fmap := template.FuncMap{
|
||||
"getCommit": func() string { return commit },
|
||||
"formatStringSlice": func(slice []string) string { return `"` + strings.Join(slice, `","`) + `"` },
|
||||
}
|
||||
|
||||
t := template.Must(template.New(tmplName).Funcs(fmap).ParseFiles(tmplPath))
|
||||
if err := t.Execute(out, extInfo); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return executeTemplate(out, tmplName, tmplPath, commit, fmap, extInfo)
|
||||
}
|
||||
|
Reference in New Issue
Block a user