Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AddFilterHook not working as intended #74

Open
mandeepbrar opened this issue May 17, 2019 · 0 comments
Open

AddFilterHook not working as intended #74

mandeepbrar opened this issue May 17, 2019 · 0 comments

Comments

@mandeepbrar
Copy link

mandeepbrar commented May 17, 2019

I added a filter hook as follows

autogen_skipper := func(info os.FileInfo, fullPath string) error {
		if info.IsDir() && info.Name() == "autogen" {
			log.Error(ctx, "skipping autogen")
			return watcher.ErrSkip
		}
		log.Error(ctx, "not skipping ")
		return nil
}
....
w.AddFilterHook(autogen_skipper)
....
w.AddRecursive(folderToWatch);

This code skips autogen directory, however the files in the autogen folder are not skipped.

Expected behavior is that if a folder is skipped then this method should not have been called for files in the folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant