tartrazine/internal/code-generator/generator/linguist-commit.go
Denys Smirnov 7eafe024af write a canonical header for machine-generated files
Signed-off-by: Denys Smirnov <denys@sourced.tech>
2018-04-30 12:57:39 +03:00

15 lines
404 B
Go

package generator
import (
"bytes"
)
// Commit takes a commit and builds the source file from tmplPath. It complies with type File signature.
func Commit(fileToParse, samplesDir, outPath, tmplPath, tmplName, commit string) error {
buf := &bytes.Buffer{}
if err := executeTemplate(buf, tmplName, tmplPath, commit, nil, nil); err != nil {
return err
}
return formatedWrite(outPath, buf.Bytes())
}