LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

goreload

Live reload tool for Go development

TLDR

Watch and reload the app in the current directory
$ goreload
copy
Watch and build a specific entry point
$ goreload [main.go]
copy
Watch a specific path
$ goreload -t [./cmd/server]
copy
Exclude a directory from watching
$ goreload -x [vendor]
copy
Reload on any file change, not just .go files
$ goreload --all
copy
Pass extra arguments to go build
$ goreload --buildArgs "[-ldflags=-s -w]"
copy

SYNOPSIS

goreload [options] [path]

DESCRIPTION

goreload is a live reload tool for Go development, forked from codegangsta/gin. It watches source files and automatically rebuilds and restarts the application when changes are detected, eliminating manual rebuild cycles.The tool supports configurable watch directories, exclude patterns, and custom build commands.

PARAMETERS

-t, --path DIR

Directory to watch for changes (default: current directory).
-d, --build DIR
Path to build files from (default: same as --path).
-b, --bin NAME
Name of the generated binary (default: .goreload).
-x, --excludeDir DIR
Relative directory to exclude from monitoring (repeatable).
--all
Reload on any file change, not just .go files.
--buildArgs ARGS
Extra arguments passed through to go build.
--logPrefix PREFIX
Custom prefix for log output.
-h, --help
Display help information.
-v, --version
Print version and exit.

CAVEATS

Development tool only. Some file events may be missed. Configure exclude patterns.

HISTORY

goreload was forked from codegangsta/gin, trimming unused features, and has itself been re-forked by several maintainers (e.g. acoshift, oxycoder) as one of many Go live-reload utilities.

SEE ALSO

air(1), nodemon(1)

RESOURCES

Copied to clipboard
Kai