golang-modernize

Modernize Go code with version-aware, safety-first idiomatic improvements.

1|Updated May 27, 2026
One-click install
npx skills add https://github.com/dmwin72015/netdisk --skill golang-modernize-dmwin72015
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-modernize
Source: https://github.com/dmwin72015/netdisk/tree/main/.agents/skills/golang-modernize
Command: npx skills add https://github.com/dmwin72015/netdisk --skill golang-modernize-dmwin72015

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It reduces technical debt and hidden correctness risks by updating older Go patterns to modern, more idiomatic language features and standard-library improvements.

Core Features & Use Cases

  • Go version-aware modernization: Detects opportunities based on the project’s targeted Go version by checking go.mod/go.work, then applying the appropriate modernization set (roughly Go 1.21–1.26 as covered by this skill).
  • Safety-first workflow: Prioritizes correctness and security fixes (e.g., path handling, deprecated/unsafe APIs) before readability improvements, and avoids broad refactors when the developer is working on unrelated tasks.
  • Tooling integration and parallel scans: Recommends running golangci-lint modernize checks when available and supports a full-scan mode using multiple sub-agents to cover deprecated packages, language improvements, standard-library updates, testing, and CI/tooling modernization.
  • Governance via ignore list: Uses a .modernize file in the project root to prevent re-suggesting previously ignored changes.

Quick Start

Ask: Modernize the Go code in this repository for our current Go version and return a prioritized list of safe, idiomatic improvements.

Frequently Asked Questions about golang-modernize

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

FAQPage Schema
How do I modernize Go code to use safer and more idiomatic language patterns?

To modernize Go code, replace outdated standard library usage and language patterns with safer, idiomatic equivalents based on your project's targeted Go version. This reduces technical debt and hidden correctness risks by applying version-aware updates.

How does golangci-lint modernize checks work for upgrading older Go repositories?

golangci-lint modernize checks scan Go repositories to detect outdated patterns and suggest safer, idiomatic equivalents. Running these checks during code reviews or CI scans identifies deprecated packages and standard library improvements across large codebases.

Can I automatically detect Go modernization opportunities based on my project's Go version?

Yes, modernization opportunities can be detected by checking go.mod or go.work files for the project's targeted Go version. This version-aware approach ensures only appropriate modernization sets, roughly Go 1.21 to 1.26, are applied to your codebase.

What is the best way to prevent a code review tool from suggesting the same Go modernization fixes repeatedly?

The best way to prevent repeated modernization suggestions is by using a .modernize ignore file in the project root. This governance file tracks previously ignored changes, stopping the tool from re-suggesting them during subsequent code reviews or full scans.

How do I prioritize safety-first changes when upgrading Go code to modern idioms?

Safety-first modernization prioritizes correctness and security fixes, such as path handling and deprecated APIs, before readability improvements. This workflow avoids broad refactors during unrelated tasks, focusing strictly on reducing hidden risks in Go code.

Does Go code modernization support parallel full scans across large repositories?

Yes, full-scan mode supports parallel modernization across large Go repositories using multiple sub-agents. This covers deprecated packages, language improvements, standard-library updates, testing, and CI tooling simultaneously for comprehensive codebase analysis.