From b4e84479fefe27c4c91bb9d1084ca0bc26c8cded Mon Sep 17 00:00:00 2001 From: Kislay Kishore Date: Mon, 27 Jan 2025 13:53:56 +0530 Subject: [PATCH] [Readability fix] Be explicit that nil child is being returned. --- internal/fs/fs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/fs/fs.go b/internal/fs/fs.go index d8c3d63946..54343adac7 100644 --- a/internal/fs/fs.go +++ b/internal/fs/fs.go @@ -981,7 +981,7 @@ func (fs *fileSystem) lookUpOrCreateChildInode( childName string) (child inode.Inode, err error) { // First check if the requested child is a localFileInode. if child, err = fs.lookUpLocalFileInode(parent, childName); err != nil { - return child, err + return nil, err } if child != nil { return @@ -1042,7 +1042,7 @@ func (fs *fileSystem) lookUpLocalFileInode(parent inode.DirInode, childName stri // If the path specified is "a/\n", the child would come as \n which is not a valid childname. // In such cases, simply return a file-not-found. if childName == inode.ConflictingFileNameSuffix { - return child, syscall.ENOENT + return nil, syscall.ENOENT } // Trim the suffix assigned to fix conflicting names. childName = strings.TrimSuffix(childName, inode.ConflictingFileNameSuffix)