diff --git a/src/html/template/template.go b/src/html/template/template.go index 4641a37da3..75437879e2 100644 --- a/src/html/template/template.go +++ b/src/html/template/template.go @@ -440,9 +440,10 @@ func parseFiles(t *Template, filenames ...string) (*Template, error) { return t, nil } -// ParseGlob creates a new Template and parses the template definitions from the -// files identified by the pattern, which must match at least one file. The -// returned template will have the (base) name and (parsed) contents of the +// ParseGlob creates a new Template and parses the template definitions from +// the files identified by the pattern. The files are matched according to the +// semantics of filepath.Match, and the pattern must match at least one file. +// The returned template will have the (base) name and (parsed) contents of the // first file matched by the pattern. ParseGlob is equivalent to calling // ParseFiles with the list of files matched by the pattern. // @@ -453,10 +454,10 @@ func ParseGlob(pattern string) (*Template, error) { } // ParseGlob parses the template definitions in the files identified by the -// pattern and associates the resulting templates with t. The pattern is -// processed by filepath.Glob and must match at least one file. ParseGlob is -// equivalent to calling t.ParseFiles with the list of files matched by the -// pattern. +// pattern and associates the resulting templates with t. The files are matched +// according to the semantics of filepath.Match, and the pattern must match at +// least one file. ParseGlob is equivalent to calling t.ParseFiles with the +// list of files matched by the pattern. // // When parsing multiple files with the same name in different directories, // the last one mentioned will be the one that results. diff --git a/src/text/template/helper.go b/src/text/template/helper.go index 9e0200c352..c9e890078c 100644 --- a/src/text/template/helper.go +++ b/src/text/template/helper.go @@ -91,9 +91,10 @@ func parseFiles(t *Template, filenames ...string) (*Template, error) { return t, nil } -// ParseGlob creates a new Template and parses the template definitions from the -// files identified by the pattern, which must match at least one file. The -// returned template will have the (base) name and (parsed) contents of the +// ParseGlob creates a new Template and parses the template definitions from +// the files identified by the pattern. The files are matched according to the +// semantics of filepath.Match, and the pattern must match at least one file. +// The returned template will have the (base) name and (parsed) contents of the // first file matched by the pattern. ParseGlob is equivalent to calling // ParseFiles with the list of files matched by the pattern. // @@ -104,10 +105,10 @@ func ParseGlob(pattern string) (*Template, error) { } // ParseGlob parses the template definitions in the files identified by the -// pattern and associates the resulting templates with t. The pattern is -// processed by filepath.Glob and must match at least one file. ParseGlob is -// equivalent to calling t.ParseFiles with the list of files matched by the -// pattern. +// pattern and associates the resulting templates with t. The files are matched +// according to the semantics of filepath.Match, and the pattern must match at +// least one file. ParseGlob is equivalent to calling t.ParseFiles with the +// list of files matched by the pattern. // // When parsing multiple files with the same name in different directories, // the last one mentioned will be the one that results.