Skip to content

Files

Latest commit

5af87d5 · Jan 5, 2017

History

History

004_parse_execute

Type Template

template.Template

Parsing templates

func ParseFiles(filenames ...string) (*Template, error)
func ParseGlob(pattern string) (*Template, error)

func (t *Template) Parse(text string) (*Template, error)
func (t *Template) ParseFiles(filenames ...string) (*Template, error)
func (t *Template) ParseGlob(pattern string) (*Template, error)

Executing templates

func (t *Template) Execute(wr io.Writer, data interface{}) error
func (t *Template) ExecuteTemplate(wr io.Writer, name string, data interface{}) error

Helpful template functions

func Must(t *Template, err error) *Template
func New(name string) *Template

The init function

func init()