-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
Packages text/template
and html/template
have a function named ParseGlob
. They have the same documentation:
// 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
// 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)
The documentation of this function does not specify the rules of what the pattern should be. As a result, users reading the documentation cannot know how to use the function.
Both these packages also have a Template.ParseGlob
method, which does specify the rules for the pattern:
// ...
// The pattern is processed by filepath.Glob and must match at least one file.
// ...
That information should be copied to the ParseGlob
function documentation as well.
/cc @julieqiu @cnoellekb
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.