Use fs methods
This commit is contained in:
parent
6a4e1cfaf1
commit
c012e3b504
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue