(templatePath string, cacheAfterParsing bool)
| 184 | } |
| 185 | |
| 186 | func (s *Set) loadFromFile(templatePath string, cacheAfterParsing bool) (template *Template, err error) { |
| 187 | f, err := s.loader.Open(templatePath) |
| 188 | if err != nil { |
| 189 | return nil, err |
| 190 | } |
| 191 | defer f.Close() |
| 192 | content, err := ioutil.ReadAll(f) |
| 193 | if err != nil { |
| 194 | return nil, err |
| 195 | } |
| 196 | return s.parse(templatePath, string(content), cacheAfterParsing) |
| 197 | } |
| 198 | |
| 199 | // Parse parses `contents` as if it were located at `templatePath`, but won't put the result into the cache. |
| 200 | // Any referenced template (e.g. via `extends` or `import` statements) will be tried to be loaded from the cache. |
no test coverage detected