Home | History | Annotate | Download | only in template

Lines Matching defs: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.
35 // For instance, ParseFiles("a/foo", "b/foo") stores "b/foo" as the template
37 func ParseFiles(filenames ...string) (*Template, error) {
42 // t. If an error occurs, parsing stops and the returned template is nil;
48 // case use t.ExecuteTemplate to execute a valid template.
52 func (t *Template) ParseFiles(filenames ...string) (*Template, error) {
58 // template is nil, it is created from the first file.
59 func parseFiles(t *Template, filenames ...string) (*Template, error) {
62 return nil, fmt.Errorf("template: no files named in call to ParseFiles")
71 // First template becomes return value if not already defined,
76 // works. Otherwise we create a new template associated with t.
77 var tmpl *Template
94 // ParseGlob creates a new Template and parses the template definitions from the
96 // returned template will have the (base) name and (parsed) contents of the
102 func ParseGlob(pattern string) (*Template, error) {
106 // ParseGlob parses the template definitions in the files identified by the
114 func (t *Template) ParseGlob(pattern string) (*Template, error) {
120 func parseGlob(t *Template, pattern string) (*Template, error) {
126 return nil, fmt.Errorf("template: pattern matches no files: %#q", pattern)