hugofs: Use os.PathError in RootMappingFs.doLstat

This commit is contained in:
Raphael Krupinski 2020-06-11 14:59:01 +02:00 committed by GitHub
parent fc0f13b684
commit 83d03a5201
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -493,7 +493,7 @@ func (fs *RootMappingFs) doLstat(name string) ([]FileMetaInfo, error) {
// Find any real files or directories with this key.
_, roots := fs.getRoots(key)
if roots == nil {
return nil, os.ErrNotExist
return nil, &os.PathError{Op: "LStat", Path: name, Err: os.ErrNotExist}
}
var err error
@ -512,7 +512,7 @@ func (fs *RootMappingFs) doLstat(name string) ([]FileMetaInfo, error) {
}
if err == nil {
err = os.ErrNotExist
err = &os.PathError{Op: "LStat", Path: name, Err: err}
}
return nil, err