update README.md

This commit is contained in:
satotake 2022-07-15 22:01:25 +09:00
parent 313c5e8bb9
commit 3c24ee4601
1 changed files with 2 additions and 2 deletions

View File

@ -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")