hugofs: Use os.PathError in RootMappingFs.doLstat
authorRaphael Krupinski <rafalkrupinski@users.noreply.github.com>
Thu, 11 Jun 2020 12:59:01 +0000 (14:59 +0200)
committerGitHub <noreply@github.com>
Thu, 11 Jun 2020 12:59:01 +0000 (14:59 +0200)
hugofs/rootmapping_fs.go

index 283bb042d92a5a5f3dfdd4699a5a5f0f98453e89..ea3ef003ecc2839d322581c342aed2f7de0a1c58 100644 (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