Missing context readDir, required for any template using readDir* functions

Signed-off-by: Arkaitz Jimenez <arkaitzj@gmail.com>
This commit is contained in:
Arkaitz Jimenez 2022-08-16 14:59:54 +02:00
parent 824f7ba2b2
commit 684be0af50
1 changed files with 2 additions and 0 deletions

View File

@ -19,6 +19,7 @@ func NewFileRenderer(readFile func(filename string) ([]byte, error), basePath st
Context: &Context{
basePath: basePath,
readFile: readFile,
readDir: os.ReadDir,
},
Data: data,
}
@ -31,6 +32,7 @@ func NewFirstPassRenderer(basePath string, data interface{}) *FileRenderer {
preRender: true,
basePath: basePath,
readFile: os.ReadFile,
readDir: os.ReadDir,
},
Data: data,
}