github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/utils/docgen/api/templates.go (about)

     1  package docgen
     2  
     3  import "text/template"
     4  
     5  func readTemplate(path string) *template.Template {
     6  	if path == "" {
     7  		return nil
     8  	}
     9  
    10  	f := fileReader(path)
    11  	tmpl := string(readAll(f))
    12  	return template.Must(template.New(path).Funcs(funcMap).Parse(tmpl))
    13  }