engine: resources: Avoid double slash on error
Errors will include a second slash if this ends with one. Might as well clean it to avoid the semblance of a bug.
This commit is contained in:
@@ -1816,7 +1816,7 @@ func ReadDir(p string) ([]FileInfo, error) {
|
|||||||
return nil, fmt.Errorf("path must be a directory")
|
return nil, fmt.Errorf("path must be a directory")
|
||||||
}
|
}
|
||||||
output := []FileInfo{} // my file info
|
output := []FileInfo{} // my file info
|
||||||
files, err := os.ReadDir(p)
|
files, err := os.ReadDir(path.Clean(p)) // clean for prettier errors
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
return output, err // return empty list
|
return output, err // return empty list
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user