Realize – Go build system with file watchers, live reload and output streams
github.com
github.com
https://github.com/cortesi/modd
The use case here is deep and interesting, and I don't know of any tool that gets it 100% right. HN is often quick to grumble about reinventing the wheel, but where there is no clearly correct solution I think we should encourage experimentation.
Modd is my opinionated take: it differs from other tools by trying to have a "proper" configuration language in which you can embed shell commands, by separating prep commands (that run and complete) and daemons (that run, but might need to be restarted on change), and by being completely agnostic about languages, test methodologies and other specificities of external tools.
You need literally no configuration: https://github.com/skelterjohn/rerun (my similar tool, created about 5-6 years ago).
github.com/cespare/reflex
is similar, but more general-purpose. (It's written in Go, but it's not for Go.)
I've not read the Linux code for them, but I think the implementation is probably similar.
This is not something I'd like to rely on.
Reading the code for Realize, he gets the directory watching facilities from https://github.com/fsnotify/fsnotify. That library seems to drop the 'buffer overflow, please reset your assumptions' message. So if it did happen, I don't think the user would have a good experience.
If you do ever depend on ReadDirectoryChanges, you do need to fallback to stat-ing files if you get an overflow. Otherwise, your milage may vary.