golang-dependency-management

Manages Go module dependencies including versioning, vulnerability scanning, and conflict resolution.

1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/rockcookies/skills --skill golang-dependency-management-rockcookies
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: golang-dependency-management
Source: https://github.com/rockcookies/skills/tree/main/skills/samber-golang/golang-dependency-management
Command: npx skills add https://github.com/rockcookies/skills --skill golang-dependency-management-rockcookies

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires govulncheck, and includes references (resource) components.

What problem does it solve? Go projects accumulate dependencies that introduce security vulnerabilities, version conflicts, and binary bloat, and developers often mishandle go.mod, go.sum, and upgrade workflows without clear guidance. ## Core Features & Use Cases - Dependency Lifecycle Management: Add, upgrade, and remove Go modules with correct commands, preferring patch-only upgrades and enforcing go mod tidy hygiene. - Security Auditing: Scan dependency trees with govulncheck call-path analysis, track outdated packages with go-mod-outdated, and analyze binary size with goweight. - Conflict Resolution & Workspaces: Diagnose version conflicts with go mod graph, apply replace/exclude/retract directives correctly, and configure go.work multi-module workspaces. - Use Case: Before a release, run govulncheck to catch CVEs in your dependency tree, upgrade with go get -u=patch, and verify go.sum integrity to prevent supply-chain tampering. ## Quick Start Ask the agent to audit your Go project's dependencies for vulnerabilities and outdated packages before your next release.

Frequently Asked Questions about golang-dependency-management

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

FAQPage Schema
How do I safely upgrade all Go dependencies?▼

Use go get -u=patch ./... for routine updates since patch versions carry no API changes per semver. Follow with go mod tidy, go test ./..., go vet ./..., and govulncheck ./... to verify the upgrade is safe.

How do I check Go dependencies for vulnerabilities?▼

Run govulncheck ./... to scan your dependency tree for known CVEs. Unlike generic scanners, govulncheck uses static analysis to trace call paths, so it only flags vulnerabilities in functions your code actually calls.

Should go.sum be committed to git?▼

Yes, go.sum must always be committed. It records cryptographic checksums of every dependency version, letting go mod verify detect supply-chain tampering if a compromised proxy substitutes malicious code.

What is the difference between replace, exclude, and retract in go.mod?▼

Replace substitutes a module version or path in the main module only, exclude blocks a specific broken version of a dependency, and retract marks your own published versions as broken. Replace and exclude are consumer-side; retract is author-side.

How does Go Minimal Version Selection work?▼

MVS selects the minimum version satisfying all requirements, not the latest available like npm or pip. If module A requires pkg@v1.2.0 and module B requires pkg@v1.3.0, Go selects v1.3.0, giving deterministic builds without a lock file.

How do I pin CLI tool versions like golangci-lint in Go?▼

For Go 1.24+, use go get -tool to add tool directives in go.mod, then run them with go tool golangci-lint. For Go versions below 1.24, use the legacy tools.go blank-import workaround instead.