From f175c2d20b297436613ad1acb7a2701fdca4a472 Mon Sep 17 00:00:00 2001 From: Manuel Carmona Date: Mon, 10 Apr 2017 10:25:52 +0200 Subject: [PATCH] changed Vendor function's comment and parameters names --- internal/code-generator/generator/vendor.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/code-generator/generator/vendor.go b/internal/code-generator/generator/vendor.go index e501607..8842621 100644 --- a/internal/code-generator/generator/vendor.go +++ b/internal/code-generator/generator/vendor.go @@ -8,27 +8,27 @@ import ( yaml "gopkg.in/yaml.v2" ) -// Vendor reads from buf and builds utils.go file from utilsTmplPath. -func Vendor(data []byte, uitlsTmplPath, utilsTmplName, commit string) ([]byte, error) { +// Vendor reads from buf and builds vendor_matchers.go file from VendorTmplPath. +func Vendor(data []byte, vendorTmplPath, vendorTmplName, commit string) ([]byte, error) { var regexpList []string if err := yaml.Unmarshal(data, ®expList); err != nil { return nil, err } buf := &bytes.Buffer{} - if err := executeVendorTemplate(buf, regexpList, uitlsTmplPath, utilsTmplName, commit); err != nil { + if err := executeVendorTemplate(buf, regexpList, vendorTmplPath, vendorTmplName, commit); err != nil { return nil, err } return buf.Bytes(), nil } -func executeVendorTemplate(out io.Writer, regexpList []string, languagesTmplPath, languagesTmpl, commit string) error { +func executeVendorTemplate(out io.Writer, regexpList []string, vendorTmplPath, languagesTmpl, commit string) error { fmap := template.FuncMap{ "getCommit": func() string { return commit }, } - t := template.Must(template.New(languagesTmpl).Funcs(fmap).ParseFiles(languagesTmplPath)) + t := template.Must(template.New(languagesTmpl).Funcs(fmap).ParseFiles(vendorTmplPath)) if err := t.Execute(out, regexpList); err != nil { return err }