From 3c24ee4601975bd676d991fd37cb34a982d2b81a Mon Sep 17 00:00:00 2001 From: satotake Date: Fri, 15 Jul 2022 22:01:25 +0900 Subject: [PATCH] update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 362bb09..ff01e10 100644 --- a/README.md +++ b/README.md @@ -303,8 +303,8 @@ Like, `RegexpFs`, files will not be created when the predicate returns false and directories are always not filtered. ```go -pred := func(path string) bool { - return strings.HasSuffix(path, ".txt") +pred := func(isDir bool, path string) bool { + return isDir || strings.HasSuffix(path, ".txt") } fs := afero.NewFilePredicateFs(afero.NewMemMapFs(), pred) _, err := fs.Create("/file.html")