diff options
Diffstat (limited to 'libgo/go/html/template/template.go')
-rw-r--r-- | libgo/go/html/template/template.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libgo/go/html/template/template.go b/libgo/go/html/template/template.go index 96ab268a7f4..063e46d6bf3 100644 --- a/libgo/go/html/template/template.go +++ b/libgo/go/html/template/template.go @@ -346,6 +346,11 @@ func Must(t *Template, err error) *Template { // the named files. The returned template's name will have the (base) name and // (parsed) contents of the first file. There must be at least one file. // If an error occurs, parsing stops and the returned *Template is nil. +// +// When parsing multiple files with the same name in different directories, +// the last one mentioned will be the one that results. +// For instance, ParseFiles("a/foo", "b/foo") stores "b/foo" as the template +// named "foo", while "a/foo" is unavailable. func ParseFiles(filenames ...string) (*Template, error) { return parseFiles(nil, filenames...) } @@ -353,6 +358,9 @@ func ParseFiles(filenames ...string) (*Template, error) { // ParseFiles parses the named files and associates the resulting templates with // t. If an error occurs, parsing stops and the returned template is nil; // otherwise it is t. There must be at least one file. +// +// When parsing multiple files with the same name in different directories, +// the last one mentioned will be the one that results. func (t *Template) ParseFiles(filenames ...string) (*Template, error) { return parseFiles(t, filenames...) } @@ -399,6 +407,9 @@ func parseFiles(t *Template, filenames ...string) (*Template, error) { // 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. +// +// When parsing multiple files with the same name in different directories, +// the last one mentioned will be the one that results. func ParseGlob(pattern string) (*Template, error) { return parseGlob(nil, pattern) } @@ -408,6 +419,9 @@ func ParseGlob(pattern string) (*Template, error) { // 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. +// +// When parsing multiple files with the same name in different directories, +// the last one mentioned will be the one that results. func (t *Template) ParseGlob(pattern string) (*Template, error) { return parseGlob(t, pattern) } |