Skip to content
gowatch is a command line tool that builds and (re)starts your go project everytime you save a Go or template file.||Go程序热编译工具,提升开发效率
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Create go.yml Nov 22, 2019
example add build_args Jul 27, 2019
screenshot add screenshot Dec 27, 2016
vendor update log Dec 4, 2017
.gitignore update .gitignore Jul 19, 2019
.travis.yml update .travis.yml:remove Go: 1.8.x Apr 24, 2019
LICENSE Initial commit Dec 24, 2016 Update Feb 26, 2020 重命名中文文档 Jan 17, 2020
config.go add build_args Jul 27, 2019
gowatch.go fix log print Sep 12, 2019
main.go 1、fix #9,add `disable_run` config Apr 24, 2019
version.go fix log print Sep 12, 2019


Build Status Go Report Card


gowatch is a command line tool that builds and (re)starts your go project everytime you save a Go or template file.


To install gowatch use the go get command:

go get

Then you can add gowatch binary to PATH environment variable in your ~/.bashrc or ~/.bash_profile file:

If you already have gowatch installed, updating gowatch is simple:

go get -u


cd /path/to/myapp

Start gowatch:



Gowatch will watch for file events, and every time you create/modify/delete a file it will build and restart the application,If go build returns an error, it will log it in stdout.

Support Options

  • -o : Not required, specify the target file path for the build
  • -p : Not required, specify the package to be built (can also be a single file)
  • -args: Not required, specify program runtime parameters, for example: -args = '-host =: 8080, -name = demo'
  • -v: Not required, display gowatch version information


gowatch -o ./bin/demo -p ./cmd/demo

Configuration file

In most cases, you don't need to specify the configuration. You can meet most of the requirements by directly executing the gowatch command. Create a gowatch.yml file in the execution directory:

# gowatch.yml configuration example

# The name of the executable file generated under the current directory execution. The default is the current directory name.
appname: "test"
# Specify the directory where the compiled object files are stored
output: /bin/demo
# The file name suffix that needs to be monitored. By default, there is only a '.go' file.
    - .yml
# The directory that needs to listen for file changes. By default, only the current directory.
    - ../pk
# Additional parameters that need to be added when running the application
    - arg1=val1
# Additional parameters that need to be added when building the application
    - -race
# Need to increase environment variables, the current environment variables are loaded by default
    - a=b
# Whether to listen to file changes in the 'vendor' folder
vendor_watch: false
# Directory that do not need to listen for file changes
    - path
# main package path, can also be a single file, multiple files separated by commas
build_pkg: ""
# build tags
build_tags: ""

# Whether to prohibit automatic operation
disable_run: false



Inspired by bee

You can’t perform that action at this time.