mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-13 23:12:24 +00:00
b7d4be5fdd
renamed tmpLinguist to repoLinguist and SimpleLinguistTestSuite to EnryTestSuit in common_test.go changed receiver's name for TestSuites to 's' fixed comments
18 lines
451 B
Go
18 lines
451 B
Go
package generator
|
|
|
|
import (
|
|
"bytes"
|
|
"text/template"
|
|
)
|
|
|
|
// 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{}
|
|
t := template.Must(template.New(tmplName).ParseFiles(tmplPath))
|
|
if err := t.Execute(buf, commit); err != nil {
|
|
return err
|
|
}
|
|
|
|
return formatedWrite(outPath, buf.Bytes())
|
|
}
|