MCPcopy
hub / github.com/flosch/pongo2 / resolveTemplate

Method resolveTemplate

template_sets.go:155–166  ·  view source on GitHub ↗
(tpl *Template, path string)

Source from the content-addressed store, hash-verified

153}
154
155func (set *TemplateSet) resolveTemplate(tpl *Template, path string) (name string, loader TemplateLoader, fd io.Reader, err error) {
156 // iterate over loaders until we appear to have a valid template
157 for _, loader = range set.loaders {
158 name = set.resolveFilenameForLoader(loader, tpl, path)
159 fd, err = loader.Get(name)
160 if err == nil {
161 return
162 }
163 }
164
165 return path, nil, nil, fmt.Errorf("unable to resolve template")
166}
167
168// CleanCache cleans the template cache. If filenames is not empty,
169// it will remove the template caches of those filenames.

Callers 3

FromFileMethod · 0.95
tagSSIParserFunction · 0.80
RawLineMethod · 0.80

Calls 2

GetMethod · 0.65

Tested by

no test coverage detected