]> Cypherpunks.ru repositories - gostls13.git/commitdiff
html/template, text/template: document glob semantics
authorAndrew Gerrand <adg@golang.org>
Fri, 31 May 2019 11:25:04 +0000 (21:25 +1000)
committerAndrew Gerrand <adg@golang.org>
Mon, 17 Jun 2019 21:53:49 +0000 (21:53 +0000)
This change updates the doc comments of the various ParseGlob functions
and methods to state that they use the semantics of filepath.Match when
matching the file name pattern.

Fixes #30608

Change-Id: Iee4bdc0a2a2f8647d1f9a910e4d72a5de9204d11
Reviewed-on: https://go-review.googlesource.com/c/go/+/179739
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
src/html/template/template.go
src/text/template/helper.go

index 4641a37da3cddbc12d83b08cca835f4469082ced..75437879e2e6b26866fe25a572a431ad6b1d7eb7 100644 (file)
@@ -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.
index 9e0200c3525433155c0cc0bf7e085e270d8b043b..c9e890078c4ea03c002ae7b5449273e4da384685 100644 (file)
@@ -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.