NewLocalFileSystemLoader creates a new LocalFilesystemLoader and allows templatesto be loaded from disk (unrestricted). If any base directory is given (or being set using SetBaseDir), this base directory is being used for path calculation in template inclusions/imports. Otherwise the path is calcula
(baseDir string)
| 55 | // for path calculation in template inclusions/imports. Otherwise the path |
| 56 | // is calculated based relatively to the including template's path. |
| 57 | func NewLocalFileSystemLoader(baseDir string) (*LocalFilesystemLoader, error) { |
| 58 | fs := &LocalFilesystemLoader{} |
| 59 | if baseDir != "" { |
| 60 | if err := fs.SetBaseDir(baseDir); err != nil { |
| 61 | return nil, err |
| 62 | } |
| 63 | } |
| 64 | return fs, nil |
| 65 | } |
| 66 | |
| 67 | // SetBaseDir sets the template's base directory. This directory will |
| 68 | // be used for any relative path in filters, tags and From*-functions to determine |
no test coverage detected
searching dependent graphs…