go-dependency-management

Manage Go module dependencies with go.mod hygiene, MVS versioning, and govulncheck auditing.

1|2|Updated Nov 25, 2017
One-click install
npx skills add https://github.com/asarchami/dotfiles --skill go-dependency-management-asarchami
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-dependency-management
Source: https://github.com/asarchami/dotfiles/tree/main/dot_config/opencode/skills/go/go-dependency-management
Command: npx skills add https://github.com/asarchami/dotfiles --skill go-dependency-management-asarchami

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Go projects accumulate dependency risk over time: stale go.mod files, uncommitted go.sum checksums, known CVEs in the tree, and version conflicts that are hard to diagnose. This Skill provides a disciplined workflow for adding, upgrading, auditing, and resolving Go module dependencies so the dependency tree stays honest and secure. ## Core Features & Use Cases - Deliberate dependency management: Confirm before adding new dependencies, pin versions explicitly, prefer patch-only upgrades with go get -u=patch ./..., and pin tools via a tools.go file. - Module hygiene and auditing: Keep go.mod and go.sum tidy and committed, vendor for hermetic builds, and run govulncheck ./... before every release to catch reachable CVEs. - Conflict resolution and deep dives: Diagnose conflicts with go mod graph and go mod why, resolve them with replace/exclude/retract, and consult references on MVS, workspaces, automated updates (Dependabot/Renovate), and graph visualization. - Use Case: Before releasing a Go service, run govulncheck on the tree, review outdated direct dependencies with go-mod-outdated, analyze binary bloat with goweight, and tidy the module before committing. ## Quick Start Ask the assistant to audit your Go project's dependencies, check for vulnerabilities with govulncheck, and safely upgrade all dependencies to their latest patch versions.

Frequently Asked Questions about go-dependency-management

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely upgrade Go module dependencies?

Use `go get -u=patch ./...` for routine updates since patch releases change no public API. Pin specific versions with `go get pkg@version`, then run `go mod tidy` and commit both go.mod and go.sum before building and testing.

How do I scan Go dependencies for vulnerabilities?

Run `govulncheck ./...` before every release. It uses static analysis to report only CVEs in code paths your project actually calls, and supports JSON output for CI integration and binary scanning with `-mode=binary`.

Dependabot vs Renovate for Go dependency updates?

Renovate is generally more mature and configurable, with native automerge, flexible grouping, and Go workspace awareness across multiple platforms. Dependabot is simpler to set up for GitHub-only projects and runs `go mod tidy` automatically.

How does Go Minimal Version Selection work?

MVS selects the minimum version satisfying all requirements rather than the latest available. If one module requires [email protected] and another requires v1.3.0, Go selects v1.3.0, producing deterministic builds without a lock file.

How do I resolve Go dependency version conflicts?

Diagnose with `go mod graph` and `go mod why -m`, then try upgrading the direct dependency first. If unresolved, use `replace` or `exclude` directives in the main module's go.mod, tidy, and verify with build and test.

When should I use go.work workspaces instead of go.mod?

Use go.work when developing multiple related local modules or working in a monorepo, since it eliminates replace directives during local development. Published libraries consumed by others should rely on go.mod alone.