Crun is a command line tool that compiles and runs your go code and watches all .go files in the current directory, recompiling and rerunning your code when the files change.
Useful to start webapps and recompiling them each time a file changes. As such it is an alternative to
go run server.go
, each time terminating the command yourself and doing go run server.go
again.
Ensure Go is installed and your GOPATH set.
Install package:
go get github.com/toonketels/crun
// Change to directory with your app go source code
cd /path/to/my/app
// Start compiling and running app
crun
You can pass additional arguments to the binary.
// additional arguments after `--` are passed to the binary
crun -- --port=:3000