Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time
July 25, 2013 07:48

gin wercker status

gin is a simple command line utility for live-reloading Go web applications. Just run gin in your app directory and your web app will be served with gin as a proxy. gin will automatically recompile your code when it detects a change. Your app will be restarted the next time it receives an HTTP request.

gin adheres to the "silence is golden" principle, so it will only complain if there was a compiler error or if you succesfully compile after an error.


Assuming you have a working Go environment and GOPATH/bin is in your PATH, gin is a breeze to install:

go get

Then verify that gin was installed correctly:

gin help

Basic usage

gin run main.go


   --laddr value, -l value       listening address for the proxy server
   --port value, -p value        port for the proxy server (default: 3000)
   --appPort value, -a value     port for the Go web server (default: 3001)
   --bin value, -b value         name of generated binary file (default: "gin-bin")
   --path value, -t value        Path to watch files from (default: ".")
   --build value, -d value       Path to build files from (defaults to same value as --path)
   --excludeDir value, -x value  Relative directories to exclude
   --immediate, -i               run the server immediately after it's built
   --all                         reloads whenever any file changes, as opposed to reloading only on .go file change
   --godep, -g                   use godep when building
   --buildArgs value             Additional go build arguments
   --certFile value              TLS Certificate
   --keyFile value               TLS Certificate Key
   --logPrefix value             Setup custom log prefix
   --notifications               enable desktop notifications
   --help, -h                    show help
   --version, -v                 print the version

Supporting Gin in Your Web app

gin assumes that your web app binds itself to the PORT environment variable so it can properly proxy requests to your app. Web frameworks like Martini do this out of the box.

Using flags?

When you normally start your server with flags if you want to override any of them when running gin we suggest you instead use as explained in this post

If you want to still use the standard flag package but support environment variables, you might want to try


Live reload utility for Go web servers







No releases published


No packages published