1
Fork 0

Use fs methods

This commit is contained in:
Jan-Lukas Else 2022-02-11 10:57:02 +01:00
parent 6a4e1cfaf1
commit c012e3b504
1 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ func InitTemplateStringsFS(filesystem fs.FS, stringsDir string, fileExt string,
defaultVariant,
}
// Check directory
if stat, err := os.Stat(stringsDir); err != nil {
if stat, err := fs.Stat(filesystem, stringsDir); err != nil {
return nil, err
} else if !stat.IsDir() {
return nil, errors.New("specified directory is no dir")
@ -42,7 +42,7 @@ func InitTemplateStringsFS(filesystem fs.FS, stringsDir string, fileExt string,
if _, ok := ts.templateStrings[variant]; ok {
continue
}
fb, err := os.ReadFile(filepath.Join(stringsDir, variant+fileExt))
fb, err := fs.ReadFile(filesystem, filepath.Join(stringsDir, variant+fileExt))
if err != nil {
// Just ignore the file
continue