Skip to content
/ gogo Public

Compiles and restarts Go apps when code changes πŸƒ

License

Notifications You must be signed in to change notification settings

ww9/gogo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

License: Unlicense Go Report Card

gogo πŸƒ

gogo compiles and restarts Go applications when code changes.

Usage

go install -i github.com/ww9/gogo

gogo main.go

Options

  -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

Features & Todo

  • 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

Rather not do

  • Config file: Passing arguments gets old but running gogo just works for most projects. Also Makefiles and shellscripts can fullfill this role.

Changelog

  • 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

Credits

This is a heavily modified fork of acoshift/goreload which itself is a fork of codegangsta/gin.

License

The Unlicense, Public Domain. As free as it gets.

About

Compiles and restarts Go apps when code changes πŸƒ

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages