LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

gow

File watcher for Go commands

TLDR

Run with auto-reload
$ gow run [.]
copy
Run specific file
$ gow run [main.go]
copy
Run tests with watching
$ gow test [./...]
copy
Clear the terminal on every restart
$ gow -c run [.]
copy
Watch additional file extensions besides .go
$ gow -e=go,mod,html run [.]
copy

SYNOPSIS

gow [flags] command [args]

DESCRIPTION

gow ("go watch") is invoked exactly like go, but additionally watches the Go source tree and reruns the given command whenever a watched file changes. It wraps go run, go test, go build, and other subcommands transparently, ignoring non-Go files by default.It uses a recursive, event-driven watcher (no polling) so restarts are near-instant, clears leftover output between runs, and supports hotkeys such as ctrl+r to force a restart.

PARAMETERS

COMMAND

Any go subcommand to wrap and re-run (run, test, build, vet, ...).
-c
Clear the terminal before each restart.
-e ext,ext,...
File extensions to watch. Default: go.
-v
Verbose output, printing what triggered each restart.
--help
Display help information.

INSTALL

nix profile install nixpkgs#gow
copy

CAVEATS

Development tool only; not intended for production process supervision. Watches recursively from the current directory by default.

HISTORY

gow was created by Nelo Mitranim as a lightweight replacement for his earlier gorun tool, adding a better file watcher and hotkey support for Go development workflows.

SEE ALSO

go(1), air(1), goreload(1)

RESOURCES

Copied to clipboard
Kai