On Wednesday, May 22, 2013 12:51:38 AM UTC-6, Andrew Romanov wrote:
gow/blob/master/gow_config.go#L42-44 somehow if I would use pointer instead of value ( (r *rule) and supplied self (not *self)), program was breaking. As well as if I would write "go self.handleEvents()". Can someone explain me why? Thanks a lot.
I'm not sure if this has to do with the older fsnotify, but I tried your program out on Go 1.1 using the new fsnotify and it seems to work as expected, though I discovered a nil deference.
A few comments:
You can send the command output directly to stdout so you'll see output as it arrives rather than all at the end:
The sync.WaitGroup in gow.go is being used strangely. Usually you'd call Done on it when each goroutine exits. Moving the goroutine to main instead of rule.watch helps:
That also removes the "go self.handleEvents()" call you found problematic, though that actually worked for me. Not sure what the problem might have been.