Golang Automatic Reloads
alexedwards.net
Golang Automatic Reloads
1–10 of 11 posts
Re: Golang Automatic Reloads
#2Or rerun by skelterjohn http://github.com/skelterjohn/rerun
Re: Golang Automatic Reloads
#3That's more of an automatic restart (kill and start the process again) than an automatic reload (update code within the running system). And surely there are non-go-specific tools which can already do that, aren't there?
Re: Golang Automatic Reloads
#4On Windows you can use something like this
http://www.nodesoft.com/foldermonitor
(freeware)
Re: Golang Automatic Reloads
#5That's more of an automatic restart (kill and start the process again) than an automatic reload (update code within the running system). And surely there are non-go-specific tools which can already do that, aren't there?
Yup, such tools exist. I've used peat before for stuff like this:
Re: Golang Automatic Reloads
#6SIGKILL seems a little aggressive for a controlled process restart.
Re: Golang Automatic Reloads
#7On Windows you can use something like this http://www.nodesoft.com/foldermonitor (freeware)
Go also provides a syscall for ReadDirectoryChanges, and one really nice Go library that uses inotify/ReadDirectoryChanges is https://github.com/howeyc/fsnotify
Re: Golang Automatic Reloads
#8SIGKILL seems a little aggressive for a controlled process restart.
Not to mention the program sigkills itself before it attempts to `exit 0`...
Re: Golang Automatic Reloads
#9CEL is a similar and more generic script: it can do that for any program and works on Linux and Mac.
Re: Golang Automatic Reloads
#10SIGKILL seems a little aggressive for a controlled process restart.
Not to mention the program sigkills itself before it attempts to `exit 0`...
Genuine question - can a process kill itself?
The kill of go-reload was to make sure background processes get cleaned up, but I suspect one of the kill or exit in the close function is superfluous.