gogo
compiles and restarts Go applications when code changes.
go install -i github.com/ww9/gogo
gogo main.go
-all reloads whenever any file changes instead of only .go files
-bin string name of generated binary file (default ".gogo")
-buildargs string additional go build arguments
-watchdir string path to monitor for file changes (default ".")
-builddir string path to build files from (defaults to -watchdir)
-excludedir value directories to skip monitoring
-godep use godep when building
-logprefix string log prefix (default "gogo")
-runargs string arguments passed when running the program
- Watches a directory and its subdirectories for .go file changes
- Recompiles and restarts the Go app when file changes are detected
- Supports listening to all file changes rather than only .go files using -all
- Tested on Windows 10
- Prevents annoying Windows firewall prompt that happens when using
go run
since it always compile to the same binary file name - Option to delete compiled file after exiting
gogo
. Perhaps enabled by default even - Add optional debounce/delay for when multiple files change simultaneously (git branch change and other tooling)
- Remove godep support (thanks for everything godep team ❤)
- Add go.mod file
- Add --files argument to allow filtering files being watched using glob matching
- Write tests including real file system usage
- Test on popular Linux distros, BSD and OSX
- Config file: Passing arguments gets old but running
gogo
just works for most projects. Also Makefiles and shellscripts can fullfill this role.
-
Removed dependency of github.com/urfave/cli in favor of
flag
from standard library -
Deleted Builder and Runner interfaces which were implemented by only one struct each
-
Added
-runargs
cli argument to allow passing arguments when running the program
This is a heavily modified fork of acoshift/goreload which itself is a fork of codegangsta/gin.
The Unlicense, Public Domain. As free as it gets.