code: func GenerateFile(data interface{}, tmplFile, tmplName, filename string, override bool) error {
  	if !override && isFileExist(filename) {
  		log.Infof("file %v already exist and override=false, no need to regenerate", filename)
  		return nil
  	}
  
  	if err := checkCreateDir(filepath.Dir(filename)); err != nil {
  	}
  
  	// pass Go function to template
  	funcMap := template.FuncMap{
  		"ToLower": strings.ToLower,
  	}
  
  	// all template files path is relative to current directory (./)
  	// while go-bindata files exist in templates directory
  	tmplFile = strings.Replace(tmplFile, "./", "", -1)
  
  	byteData, err := templates.Asset(tmplFile)
  	if err != nil {
  		return err
  	}
  
  	t, err := template.New(tmplName).Funcs(funcMap).Parse(string(byteData))
  	if err != nil {
  		return err
  	}
  
  	f, err := os.Create(filename)
  	if err != nil {
  		return err
  	}
  	defer f.Close()
  
  	log.Infof("generating file %v", filename)
  	if err := t.ExecuteTemplate(f, tmplName, data); err != nil {
  		return err
  	}
  
  	switch {
  	case strings.HasSuffix(filename, ".go"):
  		return runGoFmt(filename)
  	case strings.HasSuffix(filename, ".py"):
  		return runAutoPep8(filename)
  	}
  	return nil
  }
docs: // GenerateFile generates file from a template.
  // if file already exist and override==false, file won't be regenerated
  // funcMap = this parameter is used for passing go function to the template