aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2025-01-26 00:08:29 +0700
committerShulhan <ms@kilabit.info>2025-01-26 00:08:29 +0700
commit8d1e0fd8ec0179e9ad7ecc7a892d099729bf8dbf (patch)
tree12daf7824d2f11134334d0ad77b0ab0ae6a26314 /lib
parent863e132f8372c50fce72a33136f790e9b91b9f16 (diff)
downloadpakakeh.go-8d1e0fd8ec0179e9ad7ecc7a892d099729bf8dbf.tar.xz
lib/memfs: return nil on AddChild if path is not included
Checking if child is nil is impossible here, because the AddChild create and return new child.
Diffstat (limited to 'lib')
-rw-r--r--lib/memfs/memfs.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/memfs/memfs.go b/lib/memfs/memfs.go
index 9e02fc95..012b9839 100644
--- a/lib/memfs/memfs.go
+++ b/lib/memfs/memfs.go
@@ -76,13 +76,8 @@ func (mfs *MemFS) AddChild(parent *Node, fi os.FileInfo) (child *Node, err error
return nil, nil
}
if !mfs.Opts.isIncluded(sysPath, fi) {
- if child != nil {
- // The path being watched, but not included.
- // Set the generate function name to empty, to prevent
- // GoEmbed embed the content of this node.
- child.GenFuncName = ""
- }
- return child, nil
+ // The path being watched, but not included.
+ return nil, nil
}
child, err = parent.addChild(sysPath, fi, mfs.Opts.MaxFileSize)