[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DFJ0K898GD8XPNKSH3MVW2":3,"skill-same:01M7DFJ0K898GD8XPNKSH3MVW2":75},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":14,"repositoryHtmlUrl":43,"repositoryHomepageUrl":6,"ownerHtmlUrl":44,"ownerBlogUrl":45,"ownerDescription":46,"updatedAt":47,"install":48,"resources":60},"01M7DFJ0K898GD8XPNKSH3MVW2","golang-modernize",null,"Modernize Golang code to use recent language features, standard library improvements, and idiomatic patterns. Use when reviewing Go code with old-style patterns, when encountering a deprecation warning, or when the user asks for modernization, a Go version upgrade (e.g. to Go 1.27), or a CI\u002Ftooling refresh. Not for structural refactors, extracting functions, or moving code between packages (→ See `samber\u002Fcc-skills-golang@golang-refactoring` skill).","heynemann\u002Fomp-marketplace","heynemann","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F60965?v=4","01M7DFBD9ZDB2J2QE7R4AR0PES","Bernardo Heynemann","01M7DFBDAM3NXF540P210W3NYT",0,"MIT","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fgolang-modernize\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: golang-modernize\ndescription: \"Modernize Golang code to use recent language features, standard library improvements, and idiomatic patterns. Use when reviewing Go code with old-style patterns, when encountering a deprecation warning, or when the user asks for modernization, a Go version upgrade (e.g. to Go 1.27), or a CI\u002Ftooling refresh. Not for structural refactors, extracting functions, or moving code between packages (→ See `samber\u002Fcc-skills-golang@golang-refactoring` skill).\"\nuser-invocable: true\nlicense: MIT\ncompatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang.\nmetadata:\n  author: samber\n  version: \"1.5.1\"\n  openclaw:\n    emoji: \"🔄\"\n    homepage: https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang\n    requires:\n      bins:\n        - go\n    install: []\n    skill-library-version: \"1.27\"\nallowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch WebSearch AskUserQuestion EnterWorktree ExitWorktree\npaths:\n  - \"**\u002F*.go\"\n---\n\n\u003C!-- markdownlint-disable ol-prefix -->\n\n**Persona:** You are a Go modernization engineer. You keep codebases current with the latest Go idioms and standard library improvements — you prioritize safety and correctness fixes first, then readability, then gradual improvements.\n\n**Orchestration mode:** Fan out the five sub-agents described in Full-scan mode (deprecated packages, language features, standard library upgrades, testing patterns, tooling and infra) for a full-codebase modernization scan, and consolidate results using the migration priority guide. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly.\n\n**Modes:**\n\n- **Inline mode** (developer is actively coding): suggest only modernizations relevant to the current file or feature. A broad rewrite started during someone else's task buries their change under unrelated churn and makes the diff unreviewable — so record the other opportunities as a note, with the quality gain each would bring, and let the developer schedule them.\n- **Full-scan mode** (explicit `\u002Fgolang-modernize` invocation or CI): use up to 5 parallel sub-agents — Agent 1 scans deprecated packages and API replacements, Agent 2 scans language feature opportunities (range-over-int, min\u002Fmax, any, iterators), Agent 3 scans standard library upgrades (slices, maps, cmp, slog), Agent 4 scans testing patterns (t.Context, b.Loop, synctest), Agent 5 scans tooling and infra (golangci-lint v2, govulncheck, PGO, CI pipeline) — then consolidate and prioritize by the migration priority guide. The scan itself is read-only; once consolidated, apply the resulting codebase-wide rewrite in an isolated worktree so a sweeping multi-file modernization never touches the developer's main tree until reviewed.\n\n**Questions:** In Inline mode, this skill triggers contextually while the developer is working on something else — ask via the environment's question tool, once, whether to suggest the modernization opportunities noticed or skip for now. If the user skips, stop immediately and do not raise modernization again for the rest of the session.\n\n# Go Code Modernization Guide\n\nThis skill helps you continuously modernize Go codebases by replacing outdated patterns with their modern equivalents.\n\n**Scope**: This skill covers roughly the last 3 years of Go releases — from the oldest to the newest row in the Go Version Changelogs table below, updated each Go release. Projects targeting an older `go.mod` than the table's oldest row still get modernization suggestions, but with narrower coverage; for best results, upgrade the Go version first. Some older modernizations (e.g., `any` instead of `interface{}`, `errors.Is`\u002F`errors.As`, `strings.Cut`) are included because they are still commonly missed, but many pre-1.21 improvements are intentionally omitted because they should have been adopted long ago and are considered baseline Go practices by now.\n\nYou MUST NEVER conduct large refactoring if the developer is working on a different task. But TRY TO CONVINCE your human it would improve the code quality.\n\n## Workflow\n\nWhen invoked:\n\n1. **Check the project's `go.mod` or `go.work`** to determine the current Go version (`go` directive)\n2. **Check the latest Go version** using the Go Version Changelogs table below and suggest upgrading if the project's `go.mod` is behind\n3. **Read `.modernize`** in the project root — this file contains previously ignored suggestions; do NOT re-suggest anything listed there\n4. **Scan the codebase** for modernization opportunities based on the target Go version\n5. **Run `golangci-lint`** with the `modernize` linter if available, and `go test .\u002F...` — Go 1.27+ runs the `stdversion` vet check by default, flagging APIs newer than the module's `go` directive; bump the directive or revert the suggestion, don't ignore the hit\n6. **Suggest improvements contextually**:\n   - If the developer is actively coding, **only suggest improvements related to the code they are currently working on**. Do not refactor unrelated files. Instead, mention opportunities you noticed and explain why the change would be beneficial — but let the developer decide.\n   - If invoked explicitly via `\u002Fgolang-modernize` or in CI, scan and suggest across the entire codebase.\n7. **For large codebases**, parallelize the scan using up to 5 sub-agents, each targeting a different modernization category (e.g. deprecated packages, language features, standard library upgrades, testing patterns, tooling and infra). Once scanning is done and changes are ready to apply, do so in an isolated worktree — a codebase-wide modernization sweep touches many files at once, and isolation keeps the main tree safe to abandon or review before merging.\n8. **Before suggesting a dependency update**, run `go mod tidy` and the test suite to verify compatibility. Ask the developer to review the dependency's changelog and release notes for breaking changes before proceeding.\n9. **If the developer explicitly ignores a suggestion**, write a short memo to `.modernize` in the project root so it is not suggested again. Format: one line per ignored suggestion, with a short description.\n\nWhen applying a modernization that renames an identifier or replaces a deprecated API (e.g. `reflect.PtrTo` → `PointerTo`, `math\u002Frand` → `math\u002Frand\u002Fv2`), → See `samber\u002Fcc-skills-golang@golang-gopls` skill — safe rename updates every call site and refuses a rename that would break interface satisfaction, and post-edit diagnostics catch compile errors across the rewritten files that a blind Edit or grep\u002Fsed sweep would leave broken.\n\n### `.modernize` file format\n\n```\n# Ignored modernization suggestions\n# Format: \u003Cdate> \u003Ccategory> \u003Cdescription>\n2026-01-15 slog-migration Team decided to keep zap for now\n2026-02-01 math-rand-v2 Legacy module requires math\u002Frand compatibility\n```\n\n## Go Version Changelogs\n\nReference the relevant changelog when suggesting a modernization:\n\n| Version | Release       | Changelog                   |\n| ------- | ------------- | --------------------------- |\n| Go 1.21 | August 2023   | \u003Chttps:\u002F\u002Fgo.dev\u002Fdoc\u002Fgo1.21> |\n| Go 1.22 | February 2024 | \u003Chttps:\u002F\u002Fgo.dev\u002Fdoc\u002Fgo1.22> |\n| Go 1.23 | August 2024   | \u003Chttps:\u002F\u002Fgo.dev\u002Fdoc\u002Fgo1.23> |\n| Go 1.24 | February 2025 | \u003Chttps:\u002F\u002Fgo.dev\u002Fdoc\u002Fgo1.24> |\n| Go 1.25 | August 2025   | \u003Chttps:\u002F\u002Fgo.dev\u002Fdoc\u002Fgo1.25> |\n| Go 1.26 | February 2026 | \u003Chttps:\u002F\u002Fgo.dev\u002Fdoc\u002Fgo1.26> |\n| Go 1.27 | August 2026   | \u003Chttps:\u002F\u002Fgo.dev\u002Fdoc\u002Fgo1.27> |\n\nFor versions newer than Go 1.27, consult the official Go release notes.\n\nWhen the project's `go.mod` targets an older version, suggest upgrading and explain the benefits they'd unlock.\n\n## Using the modernize linter\n\nThe `modernize` linter (available since **golangci-lint v2.6.0**) automatically detects code that can be rewritten using newer Go features. It originates from `golang.org\u002Fx\u002Ftools\u002Fgo\u002Fanalysis\u002Fpasses\u002Fmodernize`; `gopls` and `go fix` (rewritten onto the `go\u002Fanalysis` framework in Go 1.26, with fixer coverage still growing in Go 1.27 — see [Tooling modernization](.\u002Freferences\u002Ftooling.md) for the exact fixer list) cover overlapping modernization checks, but exact coverage differs by tool version. See the `samber\u002Fcc-skills-golang@golang-lint` skill for configuration.\n\n## Version-specific modernizations\n\nFor detailed before\u002Fafter examples for each Go version (1.21–1.27) and general modernizations, see [Go version modernizations](.\u002Freferences\u002Fversions.md).\n\n## Tooling modernization\n\nFor CI tooling, govulncheck, PGO, golangci-lint v2, and AI-powered modernization pipelines, see [Tooling modernization](.\u002Freferences\u002Ftooling.md).\n\n## Deprecated Packages Migration\n\n| Deprecated | Replacement | Since |\n| --- | --- | --- |\n| `math\u002Frand` | `math\u002Frand\u002Fv2` | Go 1.22 |\n| `crypto\u002Felliptic` (most functions) | `crypto\u002Fecdh` | Go 1.21 |\n| `reflect.SliceHeader`, `StringHeader` | `unsafe.Slice`, `unsafe.String` | Go 1.21 |\n| `reflect.PtrTo` | `reflect.PointerTo` | Go 1.22 |\n| `runtime.GOROOT()` | `go env GOROOT` | Go 1.24 |\n| `runtime.SetFinalizer` | `runtime.AddCleanup` | Go 1.24 |\n| `crypto\u002Fcipher.NewOFB`, `NewCFB*` | AEAD modes or `NewCTR` | Go 1.24 |\n| `golang.org\u002Fx\u002Fcrypto\u002Fsha3` | `crypto\u002Fsha3` | Go 1.24 |\n| `golang.org\u002Fx\u002Fcrypto\u002Fhkdf` | `crypto\u002Fhkdf` | Go 1.24 |\n| `golang.org\u002Fx\u002Fcrypto\u002Fpbkdf2` | `crypto\u002Fpbkdf2` | Go 1.24 |\n| `testing\u002Fsynctest.Run` | `testing\u002Fsynctest.Test` | Go 1.25 |\n| `crypto\u002Frsa.EncryptPKCS1v15` for new encryption use | RSA-OAEP (`rsa.EncryptOAEP` \u002F `rsa.EncryptOAEPWithOptions`) or HPKE\u002FKEM design | Go 1.26 |\n| `net\u002Fhttp\u002Fhttputil.ReverseProxy.Director` | `ReverseProxy.Rewrite` | Go 1.26 |\n| `crypto\u002Ftls.Config.Rand` | `testing\u002Fcryptotest.SetGlobalRandom()` | Go 1.27 |\n| `github.com\u002Fgoogle\u002Fuuid` (simple cases) | `uuid` (stdlib) | Go 1.27 |\n\n## Go 1.27+ version-bump risk checklist\n\nSeveral Go 1.27 changes need **verification, not a rewrite**, before a `go.mod` bump ships. Most notably: a `godebug` line in `go.mod` (or `\u002F\u002Fgo:debug` comment) still pinning `asynctimerchan`, `tlsunsafeekm`, `tlsrsakex`, `tls3des`, `tls10server`, `x509keypairleaf`, or `gotypesalias` to its **old** value now fails the build. Full checklist in [Go version modernizations](.\u002Freferences\u002Fversions.md#go-127-version-bump-risk-checklist-verify-dont-rewrite).\n\n## Migration Priority Guide\n\nWhen modernizing a codebase, prioritize changes by impact:\n\n### High priority (safety and correctness)\n\n1. Remove loop variable shadow copies _(Go 1.22+)_ — prevents subtle bugs\n2. Replace `math\u002Frand` with `math\u002Frand\u002Fv2` _(Go 1.22+)_ — remove `rand.Seed` calls\n3. Use `os.Root` for user-supplied file paths _(Go 1.24+)_ — prevents path traversal\n4. Run `govulncheck` _(Go 1.22+)_ — catch known vulnerabilities\n5. Use `errors.Is`\u002F`errors.As` instead of direct comparison _(Go 1.13+)_\n6. Migrate deprecated crypto packages _(Go 1.24+)_ — security critical\n7. Before bumping to `go 1.27`, resolve removed `GODEBUG` keys and `crypto\u002Ftls.Config.Rand` callers _(Go 1.27+)_ — see the risk checklist above; a stale `GODEBUG` value now fails the build\n\n### Medium priority (readability and maintainability)\n\n8. Replace `interface{}` with `any` _(Go 1.18+)_\n9. Use `min`\u002F`max` builtins _(Go 1.21+)_\n10. Use `range` over int _(Go 1.22+)_\n11. Use `slices` and `maps` packages _(Go 1.21+)_\n12. Use `cmp.Or` for default values _(Go 1.22+)_\n13. Use `sync.OnceValue`\u002F`sync.OnceFunc` _(Go 1.21+)_\n14. Use `sync.WaitGroup.Go` _(Go 1.25+)_\n15. Use `t.Context()` in tests _(Go 1.24+)_\n16. Use `b.Loop()` in benchmarks _(Go 1.24+)_\n17. Use generic methods for helpers scoped to one type, and `strings.CutLast`\u002F`bytes.CutLast` instead of `LastIndex` slicing _(Go 1.27+)_\n18. Migrate to the `encoding\u002Fjson\u002Fv2` API — the new default since Go 1.27; review its duplicate-key and invalid-UTF-8 strictness against real payloads first _(Go 1.27+)_\n\n### Lower priority (gradual improvement)\n\n19. Migrate to `slog` from third-party loggers _(Go 1.21+)_\n20. Adopt iterators where they simplify code _(Go 1.23+)_\n21. Replace `sort.Slice` with `slices.SortFunc` _(Go 1.21+)_\n22. Use `strings.SplitSeq` and iterator variants _(Go 1.24+)_\n23. Move tool deps to `go.mod` tool directives _(Go 1.24+)_\n24. Enable PGO for production builds _(Go 1.21+)_\n25. Upgrade to golangci-lint v2 with modernize linter _(golangci-lint v2.6.0+)_\n26. Add `govulncheck` to CI pipeline\n27. Set up monthly modernization CI pipeline\n28. Replace `google\u002Fuuid`\u002F`gofrs\u002Fuuid` with the stdlib `uuid` package, after checking for RFC-variant features the stdlib doesn't cover _(Go 1.27+)_\n29. Run `go fix .\u002F...` after a toolchain upgrade to apply the safe automated transformations _(Go 1.27+)_\n30. Set up AI-driven code review in CI — loads these skills to guide review per area; see `samber\u002Fcc-skills-golang@golang-continuous-integration`\n\n## Related Skills\n\nSee `samber\u002Fcc-skills-golang@golang-concurrency`, `samber\u002Fcc-skills-golang@golang-testing`, `samber\u002Fcc-skills-golang@golang-observability`, `samber\u002Fcc-skills-golang@golang-error-handling`, `samber\u002Fcc-skills-golang@golang-lint`, `samber\u002Fcc-skills-golang@golang-continuous-integration` skills.\n\n- → See `samber\u002Fcc-skills-golang@golang-refactoring` skill for staging a large modernization sweep as small human-reviewed PRs instead of one big worktree sweep.\n","\u003C!-- markdownlint-disable ol-prefix -->\n\n**Persona:** You are a Go modernization engineer. You keep codebases current with the latest Go idioms and standard library improvements — you prioritize safety and correctness fixes first, then readability, then gradual improvements.\n\n**Orchestration mode:** Fan out the five sub-agents described in Full-scan mode (deprecated packages, language features, standard library upgrades, testing patterns, tooling and infra) for a full-codebase modernization scan, and consolidate results using the migration priority guide. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly.\n\n**Modes:**\n\n- **Inline mode** (developer is actively coding): suggest only modernizations relevant to the current file or feature. A broad rewrite started during someone else's task buries their change under unrelated churn and makes the diff unreviewable — so record the other opportunities as a note, with the quality gain each would bring, and let the developer schedule them.\n- **Full-scan mode** (explicit `\u002Fgolang-modernize` invocation or CI): use up to 5 parallel sub-agents — Agent 1 scans deprecated packages and API replacements, Agent 2 scans language feature opportunities (range-over-int, min\u002Fmax, any, iterators), Agent 3 scans standard library upgrades (slices, maps, cmp, slog), Agent 4 scans testing patterns (t.Context, b.Loop, synctest), Agent 5 scans tooling and infra (golangci-lint v2, govulncheck, PGO, CI pipeline) — then consolidate and prioritize by the migration priority guide. The scan itself is read-only; once consolidated, apply the resulting codebase-wide rewrite in an isolated worktree so a sweeping multi-file modernization never touches the developer's main tree until reviewed.\n\n**Questions:** In Inline mode, this skill triggers contextually while the developer is working on something else — ask via the environment's question tool, once, whether to suggest the modernization opportunities noticed or skip for now. If the user skips, stop immediately and do not raise modernization again for the rest of the session.\n\n# Go Code Modernization Guide\n\nThis skill helps you continuously modernize Go codebases by replacing outdated patterns with their modern equivalents.\n\n**Scope**: This skill covers roughly the last 3 years of Go releases — from the oldest to the newest row in the Go Version Changelogs table below, updated each Go release. Projects targeting an older `go.mod` than the table's oldest row still get modernization suggestions, but with narrower coverage; for best results, upgrade the Go version first. Some older modernizations (e.g., `any` instead of `interface{}`, `errors.Is`\u002F`errors.As`, `strings.Cut`) are included because they are still commonly missed, but many pre-1.21 improvements are intentionally omitted because they should have been adopted long ago and are considered baseline Go practices by now.\n\nYou MUST NEVER conduct large refactoring if the developer is working on a different task. But TRY TO CONVINCE your human it would improve the code quality.\n\n## Workflow\n\nWhen invoked:\n\n1. **Check the project's `go.mod` or `go.work`** to determine the current Go version (`go` directive)\n2. **Check the latest Go version** using the Go Version Changelogs table below and suggest upgrading if the project's `go.mod` is behind\n3. **Read `.modernize`** in the project root — this file contains previously ignored suggestions; do NOT re-suggest anything listed there\n4. **Scan the codebase** for modernization opportunities based on the target Go version\n5. **Run `golangci-lint`** with the `modernize` linter if available, and `go test .\u002F...` — Go 1.27+ runs the `stdversion` vet check by default, flagging APIs newer than the module's `go` directive; bump the directive or revert the suggestion, don't ignore the hit\n6. **Suggest improvements contextually**:\n   - If the developer is actively coding, **only suggest improvements related to the code they are currently working on**. Do not refactor unrelated files. Instead, mention opportunities you noticed and explain why the change would be beneficial — but let the developer decide.\n   - If invoked explicitly via `\u002Fgolang-modernize` or in CI, scan and suggest across the entire codebase.\n7. **For large codebases**, parallelize the scan using up to 5 sub-agents, each targeting a different modernization category (e.g. deprecated packages, language features, standard library upgrades, testing patterns, tooling and infra). Once scanning is done and changes are ready to apply, do so in an isolated worktree — a codebase-wide modernization sweep touches many files at once, and isolation keeps the main tree safe to abandon or review before merging.\n8. **Before suggesting a dependency update**, run `go mod tidy` and the test suite to verify compatibility. Ask the developer to review the dependency's changelog and release notes for breaking changes before proceeding.\n9. **If the developer explicitly ignores a suggestion**, write a short memo to `.modernize` in the project root so it is not suggested again. Format: one line per ignored suggestion, with a short description.\n\nWhen applying a modernization that renames an identifier or replaces a deprecated API (e.g. `reflect.PtrTo` → `PointerTo`, `math\u002Frand` → `math\u002Frand\u002Fv2`), → See `samber\u002Fcc-skills-golang@golang-gopls` skill — safe rename updates every call site and refuses a rename that would break interface satisfaction, and post-edit diagnostics catch compile errors across the rewritten files that a blind Edit or grep\u002Fsed sweep would leave broken.\n\n### `.modernize` file format\n\n```\n# Ignored modernization suggestions\n# Format: \u003Cdate> \u003Ccategory> \u003Cdescription>\n2026-01-15 slog-migration Team decided to keep zap for now\n2026-02-01 math-rand-v2 Legacy module requires math\u002Frand compatibility\n```\n\n## Go Version Changelogs\n\nReference the relevant changelog when suggesting a modernization:\n\n| Version | Release       | Changelog                   |\n| ------- | ------------- | --------------------------- |\n| Go 1.21 | August 2023   | \u003Chttps:\u002F\u002Fgo.dev\u002Fdoc\u002Fgo1.21> |\n| Go 1.22 | February 2024 | \u003Chttps:\u002F\u002Fgo.dev\u002Fdoc\u002Fgo1.22> |\n| Go 1.23 | August 2024   | \u003Chttps:\u002F\u002Fgo.dev\u002Fdoc\u002Fgo1.23> |\n| Go 1.24 | February 2025 | \u003Chttps:\u002F\u002Fgo.dev\u002Fdoc\u002Fgo1.24> |\n| Go 1.25 | August 2025   | \u003Chttps:\u002F\u002Fgo.dev\u002Fdoc\u002Fgo1.25> |\n| Go 1.26 | February 2026 | \u003Chttps:\u002F\u002Fgo.dev\u002Fdoc\u002Fgo1.26> |\n| Go 1.27 | August 2026   | \u003Chttps:\u002F\u002Fgo.dev\u002Fdoc\u002Fgo1.27> |\n\nFor versions newer than Go 1.27, consult the official Go release notes.\n\nWhen the project's `go.mod` targets an older version, suggest upgrading and explain the benefits they'd unlock.\n\n## Using the modernize linter\n\nThe `modernize` linter (available since **golangci-lint v2.6.0**) automatically detects code that can be rewritten using newer Go features. It originates from `golang.org\u002Fx\u002Ftools\u002Fgo\u002Fanalysis\u002Fpasses\u002Fmodernize`; `gopls` and `go fix` (rewritten onto the `go\u002Fanalysis` framework in Go 1.26, with fixer coverage still growing in Go 1.27 — see [Tooling modernization](.\u002Freferences\u002Ftooling.md) for the exact fixer list) cover overlapping modernization checks, but exact coverage differs by tool version. See the `samber\u002Fcc-skills-golang@golang-lint` skill for configuration.\n\n## Version-specific modernizations\n\nFor detailed before\u002Fafter examples for each Go version (1.21–1.27) and general modernizations, see [Go version modernizations](.\u002Freferences\u002Fversions.md).\n\n## Tooling modernization\n\nFor CI tooling, govulncheck, PGO, golangci-lint v2, and AI-powered modernization pipelines, see [Tooling modernization](.\u002Freferences\u002Ftooling.md).\n\n## Deprecated Packages Migration\n\n| Deprecated | Replacement | Since |\n| --- | --- | --- |\n| `math\u002Frand` | `math\u002Frand\u002Fv2` | Go 1.22 |\n| `crypto\u002Felliptic` (most functions) | `crypto\u002Fecdh` | Go 1.21 |\n| `reflect.SliceHeader`, `StringHeader` | `unsafe.Slice`, `unsafe.String` | Go 1.21 |\n| `reflect.PtrTo` | `reflect.PointerTo` | Go 1.22 |\n| `runtime.GOROOT()` | `go env GOROOT` | Go 1.24 |\n| `runtime.SetFinalizer` | `runtime.AddCleanup` | Go 1.24 |\n| `crypto\u002Fcipher.NewOFB`, `NewCFB*` | AEAD modes or `NewCTR` | Go 1.24 |\n| `golang.org\u002Fx\u002Fcrypto\u002Fsha3` | `crypto\u002Fsha3` | Go 1.24 |\n| `golang.org\u002Fx\u002Fcrypto\u002Fhkdf` | `crypto\u002Fhkdf` | Go 1.24 |\n| `golang.org\u002Fx\u002Fcrypto\u002Fpbkdf2` | `crypto\u002Fpbkdf2` | Go 1.24 |\n| `testing\u002Fsynctest.Run` | `testing\u002Fsynctest.Test` | Go 1.25 |\n| `crypto\u002Frsa.EncryptPKCS1v15` for new encryption use | RSA-OAEP (`rsa.EncryptOAEP` \u002F `rsa.EncryptOAEPWithOptions`) or HPKE\u002FKEM design | Go 1.26 |\n| `net\u002Fhttp\u002Fhttputil.ReverseProxy.Director` | `ReverseProxy.Rewrite` | Go 1.26 |\n| `crypto\u002Ftls.Config.Rand` | `testing\u002Fcryptotest.SetGlobalRandom()` | Go 1.27 |\n| `github.com\u002Fgoogle\u002Fuuid` (simple cases) | `uuid` (stdlib) | Go 1.27 |\n\n## Go 1.27+ version-bump risk checklist\n\nSeveral Go 1.27 changes need **verification, not a rewrite**, before a `go.mod` bump ships. Most notably: a `godebug` line in `go.mod` (or `\u002F\u002Fgo:debug` comment) still pinning `asynctimerchan`, `tlsunsafeekm`, `tlsrsakex`, `tls3des`, `tls10server`, `x509keypairleaf`, or `gotypesalias` to its **old** value now fails the build. Full checklist in [Go version modernizations](.\u002Freferences\u002Fversions.md#go-127-version-bump-risk-checklist-verify-dont-rewrite).\n\n## Migration Priority Guide\n\nWhen modernizing a codebase, prioritize changes by impact:\n\n### High priority (safety and correctness)\n\n1. Remove loop variable shadow copies _(Go 1.22+)_ — prevents subtle bugs\n2. Replace `math\u002Frand` with `math\u002Frand\u002Fv2` _(Go 1.22+)_ — remove `rand.Seed` calls\n3. Use `os.Root` for user-supplied file paths _(Go 1.24+)_ — prevents path traversal\n4. Run `govulncheck` _(Go 1.22+)_ — catch known vulnerabilities\n5. Use `errors.Is`\u002F`errors.As` instead of direct comparison _(Go 1.13+)_\n6. Migrate deprecated crypto packages _(Go 1.24+)_ — security critical\n7. Before bumping to `go 1.27`, resolve removed `GODEBUG` keys and `crypto\u002Ftls.Config.Rand` callers _(Go 1.27+)_ — see the risk checklist above; a stale `GODEBUG` value now fails the build\n\n### Medium priority (readability and maintainability)\n\n8. Replace `interface{}` with `any` _(Go 1.18+)_\n9. Use `min`\u002F`max` builtins _(Go 1.21+)_\n10. Use `range` over int _(Go 1.22+)_\n11. Use `slices` and `maps` packages _(Go 1.21+)_\n12. Use `cmp.Or` for default values _(Go 1.22+)_\n13. Use `sync.OnceValue`\u002F`sync.OnceFunc` _(Go 1.21+)_\n14. Use `sync.WaitGroup.Go` _(Go 1.25+)_\n15. Use `t.Context()` in tests _(Go 1.24+)_\n16. Use `b.Loop()` in benchmarks _(Go 1.24+)_\n17. Use generic methods for helpers scoped to one type, and `strings.CutLast`\u002F`bytes.CutLast` instead of `LastIndex` slicing _(Go 1.27+)_\n18. Migrate to the `encoding\u002Fjson\u002Fv2` API — the new default since Go 1.27; review its duplicate-key and invalid-UTF-8 strictness against real payloads first _(Go 1.27+)_\n\n### Lower priority (gradual improvement)\n\n19. Migrate to `slog` from third-party loggers _(Go 1.21+)_\n20. Adopt iterators where they simplify code _(Go 1.23+)_\n21. Replace `sort.Slice` with `slices.SortFunc` _(Go 1.21+)_\n22. Use `strings.SplitSeq` and iterator variants _(Go 1.24+)_\n23. Move tool deps to `go.mod` tool directives _(Go 1.24+)_\n24. Enable PGO for production builds _(Go 1.21+)_\n25. Upgrade to golangci-lint v2 with modernize linter _(golangci-lint v2.6.0+)_\n26. Add `govulncheck` to CI pipeline\n27. Set up monthly modernization CI pipeline\n28. Replace `google\u002Fuuid`\u002F`gofrs\u002Fuuid` with the stdlib `uuid` package, after checking for RFC-variant features the stdlib doesn't cover _(Go 1.27+)_\n29. Run `go fix .\u002F...` after a toolchain upgrade to apply the safe automated transformations _(Go 1.27+)_\n30. Set up AI-driven code review in CI — loads these skills to guide review per area; see `samber\u002Fcc-skills-golang@golang-continuous-integration`\n\n## Related Skills\n\nSee `samber\u002Fcc-skills-golang@golang-concurrency`, `samber\u002Fcc-skills-golang@golang-testing`, `samber\u002Fcc-skills-golang@golang-observability`, `samber\u002Fcc-skills-golang@golang-error-handling`, `samber\u002Fcc-skills-golang@golang-lint`, `samber\u002Fcc-skills-golang@golang-continuous-integration` skills.\n\n- → See `samber\u002Fcc-skills-golang@golang-refactoring` skill for staging a large modernization sweep as small human-reviewed PRs instead of one big worktree sweep.\n",{"name":5,"paths":24,"license":15,"metadata":26,"description":7,"allowed-tools":37,"compatibility":38,"user-invocable":39},[25],"**\u002F*.go",{"author":27,"version":28,"openclaw":29},"samber","1.5.1",{"emoji":30,"install":31,"homepage":32,"requires":33,"skill-library-version":36},"🔄",[],"https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang",{"bins":34},[35],"go","1.27","Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch WebSearch AskUserQuestion EnterWorktree ExitWorktree","Designed for Claude Code, Codex or similar harness, and for projects using Golang.",true,"main","2147d79c9cd764770418b462c29634bcdc710096","plugins\u002Fbase\u002Fskills\u002Fgolang-modernize","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace","https:\u002F\u002Fgithub.com\u002Fheynemann","http:\u002F\u002Fwww.thumbor.org","CTO @ Flutter Brazil | Former Meta & Coinbase","2026-09-29 21:26:05",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":39},[50,53,56],{"tool":51,"command":52},"npx","npx skills add heynemann\u002Fomp-marketplace --skill golang-modernize",{"tool":54,"command":55},"bunx","bunx skills add heynemann\u002Fomp-marketplace --skill golang-modernize",{"tool":57,"command":58},"pnpm","pnpm dlx skills add heynemann\u002Fomp-marketplace --skill golang-modernize","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fgolang-modernize\u002FSKILL.md",[61,67,71],{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},"evals\u002Fevals.json","REFERENCE","参考文档",46704,"https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fgolang-modernize\u002Fevals\u002Fevals.json",{"path":68,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Ftooling.md",4225,"https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fgolang-modernize\u002Freferences\u002Ftooling.md",{"path":72,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fversions.md",35884,"https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fgolang-modernize\u002Freferences\u002Fversions.md",[76,83,90,97,104,111],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7DFXDYP0N6P8KR0AF7C0TDK","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7DFX9C5B0T1T0AVDCWNR5P2","write-skill","Use when creating, designing, or fixing an agent skill (SKILL.md pack) — triggers include \"write a skill\", \"make me a skill\", \"create a skill\", skill directories, and skills that fail to trigger or fire on the wrong tasks.","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fwrite-skill\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7DFX64VSTQV0CSGYR76MPZF","write-agent","Use when creating, designing, or fixing an omp subagent (task agent) — triggers include \"write an agent\", \"make me an agent\", \"create a subagent\", agent `.md` definitions, and agents that misbehave when spawned via task.","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fwrite-agent\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M7DFX22JEY7ZN9EDESM732K5","wizard","Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fwizard\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M7DFWYXR5V2CY2BPDAAS19R1","wayfinder","Plan a huge chunk of work (more than one agent session can hold) as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fwayfinder\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":19},"01M7DFWXFFMBKV294WS66S475V","wait-what","Stop. That last message did not land: re-pitch it.","https:\u002F\u002Fgithub.com\u002Fheynemann\u002Fomp-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fbase\u002Fskills\u002Fwait-what\u002FSKILL.md",[],[]]