// tmpl executes the given template text on data, writing the result to w.
tmpl executes the given template text on data, writing the result to w.
// tmpl executes the given template text on data writing the result to w .
func tmpl(w io.Writer, text string, data interface{}) {
	t := template.New("top")
	t.Funcs(template.FuncMap{"trim": strings.TrimSpace, "capitalize": capitalize})
	template.Must(t.Parse(text))
	ew := &errWriter{w: w}
	err := t.Execute(ew, data)
	if ew.err != nil {
		if strings.Contains(ew.err.Error(), "pipe") {
			os.Exit(1)
		}
		base.Fatalf("writing output: %v", ew.err)
	}
	if err != nil {
		panic(err)
	}
}
func tmpl ( w io . Writer , text string , data interface { } ) { t := template . New ( " " ) t . Funcs ( template . FuncMap { " " : strings . TrimSpace , " " : capitalize } ) template . Must ( t . Parse ( text ) ) ew := & errWriter { w : w } err := t . Execute ( ew , data ) if ew . err != nil { if strings . Contains ( ew . err . Error ( ) , " " ) { os . Exit ( 1 ) } base . Fatalf ( " " , ew . err ) } if err != nil { panic ( err ) } }
tmpl executes the given template text on data, writing the result to w.
tmpl executes the given template text on data writing the result to w .
// I/O error writing. Ignore write on closed pipe.