koanf
koanf copied to clipboard
fix: pass event to callback instead of nil when file changes detected
This pull request makes a targeted fix to the file watching logic in the providers/file/file.go file. The change ensures that the callback function receives the actual file system event object rather than nil, which allows consumers of the API to have more context about the event that triggered the callback.
File watching improvement:
- Modified the
Watchmethod inFileto pass the actualeventobject to the callback instead ofnil, providing more context to callback consumers.
Looks good @josepdcs. Once you've test and confirm, we can merge.
Hi @knadh
I confirm that it works, and I’ve also modified the TestWatchFile test by adding an assertion to verify that the event is present and not nil.
LGTM :+1: