godepmon

command module
v0.0.0-...-4aa6a5f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 16 Imported by: 0

README

Godepmon

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.

Features

  • 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.

Getting Started

Installing
go install github.com/midsbie/godepmon@latest
Usage

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 to go 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).
Examples

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

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. All contributions are greatly appreciated.

License

Distributed under the MIT License. See LICENSE for more information.

Documentation

Overview

This package implements godepmon, a tool for automatically monitoring Go packages and their dependencies for changes, and executing a specified command upon detection of any changes. It is designed to streamline the development workflow by providing real-time feedback.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL