providers/os: Fix incorrect return value count
This commit is contained in:
parent
2293780131
commit
a377995a5b
@ -148,12 +148,12 @@ func (this *state) funcWriteFile (name, content string) error {
|
||||
|
||||
func (this *state) countFiles(name string) (int, error) {
|
||||
name, err := this.document.Rel(name)
|
||||
if err != nil { return err }
|
||||
if err != nil { return 0, err }
|
||||
// genuinely can't believe this is the only way to do it, we have to
|
||||
// read their names and everything, all that work just to know how many
|
||||
// files there are, its slightly upsetting
|
||||
files, err := os.ReadDir(name)
|
||||
if err != nil { return err }
|
||||
if err != nil { return 0, err }
|
||||
return len(files), nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user