A bash script to automatically reload a go program when .go or .html files change in the monitored directory. It uses inotify.
Do you have inotify-tools already installed? Great, then skip step 1.
$ sudo apt-get install inotify-tools
Replace apt-get install with whatever package manager you use.
$ curl http://raw.github.com/nickjj/gowatcher/gowatcher > gowatcher && chmod 700 gowatcher
That just grabs the latest copy from this repo and changes the privileges of the file so that it is executable.
At this point you'll want to move gowatcher into a directory that is on your system path so that you can run it from any directory.
You're also done unless you do not know how to do that, in which case continue onto step 3.
If you do not have any directories on your system path it is pretty common to add a bin folder in your home directory. You can do that if you like and then at the bottom of your .bashrc file you can add:
export PATH=/home/username/bin
If you have one path there already you can separate it by a colon. Example:
export PATH=/home/username/bin:/some/other/path
Where username is your actual username, then save the file and reload your shell by doing:
$ source ~/.bashrc
$ cd path/to/the/dir/you/want/to/watch
$ gowatcher file-to-start.go
In other words, goto the directory you want to monitor and input the path to the go file containing your main() function.