Skip to content

Commit

Permalink
[Readability fix] Be explicit that nil child is being returned.
Browse files Browse the repository at this point in the history
  • Loading branch information
kislaykishore committed Jan 27, 2025
1 parent 842b15b commit b4e8447
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b4e8447

Please sign in to comment.