Lines Matching full:template
7 package template
17 // Must is a helper that wraps a call to a function returning (*Template, error)
20 // var t = template.Must(template.New("name").Parse("text"))
21 func Must(t *Template, err error) *Template {
28 // ParseFiles creates a new Template and parses the template definitions from
29 // the named files. The returned template's name will have the base name and
31 // If an error occurs, parsing stops and the returned *Template is nil.
32 func ParseFiles(filenames ...string) (*Template, error) {
37 // t. If an error occurs, parsing stops and the returned template is nil;
43 // case use t.ExecuteTemplate to execute a valid template.
44 func (t *Template) ParseFiles(filenames ...string) (*Template, error) {
50 // template is nil, it is created from the first file.
51 func parseFiles(t *Template, filenames ...string) (*Template, error) {
54 return nil, fmt.Errorf("template: no files named in call to ParseFiles")
63 // First template becomes return value if not already defined,
68 // works. Otherwise we create a new template associated with t.
69 var tmpl *Template
86 // ParseGlob creates a new Template and parses the template definitions from the
88 // returned template will have the (base) name and (parsed) contents of the
91 func ParseGlob(pattern string) (*Template, error) {
95 // ParseGlob parses the template definitions in the files identified by the
100 func (t *Template) ParseGlob(pattern string) (*Template, error) {
106 func parseGlob(t *Template, pattern string) (*Template, error) {
112 return nil, fmt.Errorf("template: pattern matches no files: %#q", pattern)