Godepmon is a real-time monitoring tool designed to enhance the Go development workflow by automatically observing changes in Go packages and their dependencies. Upon detecting any modifications, it executes a predefined command, offering immediate feedback and streamlining the development process for Go developers.
- Watches over your Go package and its dependencies for any changes, ensuring your project is always up-to-date with the latest modifications.
- Ideal for Docker development, Godepmon automates rebuilds and eliminates manual container restarts with every code change.
- Unlike simplistic file watchers, it smartly scans for dependencies, ensuring that only relevant changes trigger the execution command. This approach avoids unnecessary builds or tests when unrelated files are modified.
- Executes a specified command (e.g.,
go run .
,go build
,go test
) automatically upon detecting changes. - Provides the flexibility of optionally including external dependencies in the monitoring process.
go install github.com/midsbie/godepmon@latest
To start monitoring your Go package and execute a command when changes are made, simply run:
godepmon [flags] [path] [--] [command]
Positional arguments:
path
: Optional. Specifies the Go package path to monitor. Defaults to the current directory if not provided.command
: Optional. Specifies the command to execute when changes are detected. Defaults togo run .
at given path.
Flags:
--include-external-deps
: Include external dependencies in the monitoring process.-v
,--verbose
: Increase verbosity. Use multiple times for more verbose output (up to three levels; e.g.-vvv
).
Monitor the current directory and execute go test upon detecting changes:
godepmon . -- go test
Monitor a specific package and include external dependencies:
godepmon --include-external-deps ./path/to/package -- go build -v
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. All contributions are greatly appreciated.
Distributed under the MIT License. See LICENSE for more information.