# go-modern-guidelines | JetBrains | Knowledge Base | Instagit

Help AI coding agents write modern Go

GitHub Stars: 2.6k

Repository: https://github.com/jetbrains/go-modern-guidelines

---

## Articles

### [Supported Guideline IDs and Their Normalization in the JetBrains Go Modern Guidelines CLI](/jetbrains/go-modern-guidelines/supported-guideline-ids-cli-normalization)

Discover supported guideline IDs like G001 in the JetBrains Go Modern Guidelines CLI. Learn how normalizeGuidelineIDs normalizes input for efficient use.

- Tags: api-reference
- Published: 2026-09-04

### [Why `time.Tick` in Go 1.23+ No Longer Needs Explicit `Stop` Calls for Garbage Collection](/jetbrains/go-modern-guidelines/time-tick-go-1-23-no-explicit-stop-gc)

Discover how Go 1.23+ handles `time.Tick` automatically, eliminating goroutine leaks and manual Stop calls. Learn about improved garbage collection for tickers.

- Tags: internals
- Published: 2026-09-04

### [cmp.Or Evaluation Semantics vs. Inline If-Else Chains in Go](/jetbrains/go-modern-guidelines/cmp-or-evaluation-semantics-vs-inline-if-else-chains)

Understand cmp.Or evaluation semantics vs. if-else chains in Go. Learn how cmp.Or eagerly evaluates arguments, ensuring side effects always execute.

- Tags: deep-dive
- Published: 2026-09-04

### [How to Migrate from `encoding/json` to `encoding/json/v2`: A Complete Guide for Go 1.27+](/jetbrains/go-modern-guidelines/migration-strategy-encoding-json-to-encoding-json-v2)

Learn the recommended migration strategy from encoding/json to encoding/json/v2 in Go 1.27+. Run both side-by-side, preserve legacy behavior, and gradually adopt stricter defaults.

- Tags: migration-guide
- Published: 2026-09-04

### [How errors.AsType[T] Provides Compile-Time Type Safety Over errors.As](/jetbrains/go-modern-guidelines/errors-astype-t-type-safety-vs-errors-as)

Discover how errors.AsType[T] provides compile-time type safety over errors.As by leveraging Go generics to enforce type correctness, eliminating runtime checks.

- Tags: deep-dive
- Published: 2026-09-04

### [How `context.AfterFunc` Prevents Goroutine Leaks Over Manual `ctx.Done()` Watching](/jetbrains/go-modern-guidelines/context-afterfunc-prevent-goroutine-leaks-vs-ctx-done-watching)

Discover how context.AfterFunc prevents goroutine leaks by registering callbacks directly with context cancellation, avoiding manual ctx.Done() watching and memory accumulation.

- Tags: deep-dive
- Published: 2026-09-04

### [Edge Cases for `maps.Delete` vs Manual Delete Loops in Go](/jetbrains/go-modern-guidelines/edge-cases-maps-deletefunc-vs-manual-delete-loops)

Explore Go edge cases: maps.DeleteFunc panics on nil maps, unlike built-in delete. Learn which map deletion method to use for robust code.

- Tags: deep-dive
- Published: 2026-09-04

### [WaitGroup.Go Pattern vs Manual Add/Done in Go: A Safety Comparison](/jetbrains/go-modern-guidelines/waitgroup-go-pattern-vs-manual-add-done-concurrency)

Explore the WaitGroup Go pattern vs manual Add Done for safer Go concurrency. Learn how WaitGroup Go prevents race conditions and boilerplate for streamlined parallel execution.

- Tags: deep-dive
- Published: 2026-09-04

### [encoding/json/v2 vs encoding/json in Go 1.27+: Impact and Migration Guide](/jetbrains/go-modern-guidelines/impact-encoding-json-v2-vs-encoding-json-go-1-27)

Explore the impact of encoding/json/v2 vs encoding/json in Go 1.27+. Understand strict validation changes and wire-format incompatibilities. Get a migration guide now.

- Tags: migration-guide
- Published: 2026-09-04

### [How to Add a New Guideline to guidelines.json and Regenerate Documentation in Go Modern Guidelines](/jetbrains/go-modern-guidelines/add-new-guideline-guidelines-json-regenerate-documentation)

Learn how to add a new guideline to guidelines.json and regenerate documentation in Go Modern Guidelines. Follow our simple steps to update your project's guidelines.

- Tags: how-to-guide
- Published: 2026-09-04

### [Why go-modern-guidelines Requires Go 1.25+ and How It Handles Older Toolchains](/jetbrains/go-modern-guidelines/cli-requires-go-1-25-toolchain-older-versions-behavior)

Discover why go-modern-guidelines needs Go 1.25+ and how it manages older toolchains. Learn about automatic downloads for seamless upgrades.

- Tags: internals
- Published: 2026-09-04

### [How the supportedGuidelines Function Filters Guidelines by Go Version](/jetbrains/go-modern-guidelines/how-supportedguidelines-function-filters-guidelines-go-version)

Learn how supportedGuidelines filters Go guidelines by version using goversion.Compare, keeping only those matching your target Go version.

- Tags: internals
- Published: 2026-09-04

### [Schema Structure for Guideline Entries in guidelines.json: Complete Reference](/jetbrains/go-modern-guidelines/schema-structure-guideline-entries-guidelines-json)

Understand the schema structure for guideline entries in guidelines.json. Explore the Guideline struct's fields for IDs, version constraints, severity, and code examples.

- Tags: api-reference
- Published: 2026-09-04

### [How the JetBrains Go Feature Generator (featuresgen) Creates FEATURES.md](/jetbrains/go-modern-guidelines/how-feature-generator-create-features-md-from-guidelines-json)

Discover how the JetBrains featuresgen tool converts guidelines.json into FEATURES.md by parsing JSON, building Markdown tables, and adding syntax-highlighted code examples. Learn the process.

- Tags: internals
- Published: 2026-09-04

### [Why the go-modern-guidelines CLI Installs to ~/.cache/go-modern-guidelines and How Caching Works](/jetbrains/go-modern-guidelines/cli-install-cache-go-modern-guidelines-caching-behavior)

Discover why go-modern-guidelines CLI installs to ~/.cache/go-modern-guidelines and how its caching mechanism speeds up your workflow by avoiding recompilation.

- Tags: internals
- Published: 2026-09-04

### [How to Configure Local Development Mode with GO_MODERN_GUIDELINES_DEV=1](/jetbrains/go-modern-guidelines/configure-local-development-mode-go-modern-guidelines-dev-1)

Configure local development for JetBrains go-modern-guidelines by setting GO_MODERN_GUIDELINES_DEV=1. Load the CLI binary locally for faster iteration and debugging.

- Tags: how-to-guide
- Published: 2026-09-04

### [The Difference Between Guidelines With and Without a Modernize Analyzer](/jetbrains/go-modern-guidelines/difference-guidelines-with-without-modernize-analyzer)

Understand the difference between go guidelines with and without a modernize analyzer. Discover how automated analysis speeds up code improvement and manual application.

- Tags: deep-dive
- Published: 2026-09-04

### [How Schema Validation Works for guidelines.json in JetBrains/go-modern-guidelines](/jetbrains/go-modern-guidelines/how-schema-validation-works-guidelines-json)

Understand how schema validation works for guidelines.json in JetBrains/go-modern-guidelines. Discover the 13-step validation pipeline that ensures JSON syntax, ID uniqueness, Go version ordering, and example completeness.

- Tags: internals
- Published: 2026-09-04

### [Internal Architecture of the go-modern-guidelines Loading System: A Deep Dive](/jetbrains/go-modern-guidelines/internal-architecture-go-modern-guidelines-loading-system)

Explore the internal architecture of the go-modern-guidelines loading system. Learn how it embeds, validates, and constructs runtime models for efficient guideline access.

- Tags: deep-dive
- Published: 2026-09-04

### [How the go-modern-guidelines CLI Determines the Target Go Version from go.mod](/jetbrains/go-modern-guidelines/how-go-modern-guidelines-cli-determine-target-go-version-from-go-mod)

Learn how the go-modern-guidelines CLI finds your target Go version. It checks flags, go.mod files, and falls back to your local toolchain.

- Tags: internals
- Published: 2026-09-04

### [How go-modern-guidelines Validates sync.OnceFunc and sync.OnceValue Concurrent Patterns](/jetbrains/go-modern-guidelines/how-tool-handles-sync-oncefunc-and-sync-oncevalue-go-1-21)

Discover how go-modern-guidelines validates sync.OnceFunc and sync.OnceValue in Go 1.21. Ensure your concurrent patterns avoid data races and redundant synchronization for robust singletons and side effects.

- Tags: deep-dive
- Published: 2026-08-30

### [Testing Strategies to Validate Go Modern Guidelines Across Different Go Versions](/jetbrains/go-modern-guidelines/testing-strategies-validate-guideline-correctness-go-versions)

Validate Go modern guidelines across Go versions with a multi-layered test suite. Discover version-aware filtering, Go version resolution, and JSON schema validation strategies.

- Tags: testing-strategies
- Published: 2026-08-30

### [How to Migrate Existing Code to Use the Standard uuid Package in Go](/jetbrains/go-modern-guidelines/how-to-migrate-to-standard-uuid-package)

Easily migrate your Go code to the standard uuid package. Update imports, refactor calls, and tidy dependencies for a cleaner, more efficient solution.

- Tags: migration-guide
- Published: 2026-08-30

### [What Is the Role of `golang.org/x/mod` in the Go‑Modern‑Guidelines Dependency Chain?](/jetbrains/go-modern-guidelines/role-of-golang-org-x-mod-in-tools-dependency-chain)

Discover how golang.org/x/mod powers the go-modern-guidelines tool by parsing Go version directives from go.mod and go.work files. Learn its crucial role in the dependency chain.

- Tags: internals
- Published: 2026-08-30

### [How `errors.AsType[T]` in Go 1.26 Improves Type-Safe Error Handling](/jetbrains/go-modern-guidelines/errors-astype-t-go-1-26-type-safe-error-handling)

Go 1.26's errors.AsType[T] offers type-safe error handling without boilerplate. Discover how this generic helper simplifies matching errors and improves your Go code clarity.

- Tags: deep-dive
- Published: 2026-08-30

### [How to Use `omitzero` vs `omitempty` in Go JSON Struct Tags: Complete Guide](/jetbrains/go-modern-guidelines/correct-usage-omitzero-vs-omitempty-json-struct-tags)

Master Go JSON struct tags by understanding omitzero vs omitempty. Learn when to use each to efficiently omit zero values and empty collections in your Go applications.

- Tags: how-to-guide
- Published: 2026-08-30

### [How HTTP ServeMux Pattern Matching in Go 1.22 Improves Routing Over Manual Path Parsing](/jetbrains/go-modern-guidelines/http-servermux-pattern-matching-go-1-22-routing-improvements)

Go 1.22's HTTP ServeMux pattern matching simplifies routing with method-aware patterns like GET /api/{id}. Extract path values effortlessly without manual parsing.

- Tags: deep-dive
- Published: 2026-08-30

### [Difference Between `any` and `interface{}` Usage Patterns in Go](/jetbrains/go-modern-guidelines/difference-between-any-and-interface-usage-patterns)

Understand the difference between any and interface{} in Go 1.18. Learn when to use any for modern, generic code and reserve interface{} for legacy APIs.

- Tags: deep-dive
- Published: 2026-08-30

### [slices.Contains vs slices.Index vs slices.IndexFunc: Comparing Go Slice Search Operations](/jetbrains/go-modern-guidelines/slices-contains-vs-index-vs-indexfunc-slice-search)

Compare Go's slices Contains Index and IndexFunc for efficient slice searching. Learn to choose the right O(n) lookup method and avoid manual loops.

- Tags: deep-dive
- Published: 2026-08-30

### [How to Handle Loop Variable Capture Issues in Go 1.22+: JetBrains Guidelines](/jetbrains/go-modern-guidelines/handling-loop-variable-capture-issues-go-1-22-plus)

Go 1.22 simplifies loop variable capture by creating copies for each iteration. Discover how this new feature enhances closure and goroutine usage according to JetBrains guidelines.

- Tags: how-to-guide
- Published: 2026-08-30

### [How to Debug Outdated Go Code Generated by AI Agents: 5 Systematic Strategies](/jetbrains/go-modern-guidelines/debugging-strategies-ai-agent-outdated-go-code)

Debug outdated AI-generated Go code with 5 systematic strategies. Leverage JetBrains go-modern-guidelines to detect Go versions and validate code. Refine AI prompts for modern patterns.

- Tags: how-to-guide
- Published: 2026-08-30

### [How the go-modern-guidelines Tool Handles Go 1.22's `range over int` Feature](/jetbrains/go-modern-guidelines/how-tool-handles-range-over-int-go-1-22)

Discover how the go-modern-guidelines tool simplifies Go 1.22 range over int syntax, replacing classic loops with concise range loops while preserving traditional loops for complex cases.

- Tags: deep-dive
- Published: 2026-08-30

### [encoding/json vs encoding/json/v2 in Go 1.27: Key Differences Explained](/jetbrains/go-modern-guidelines/differences-between-encoding-json-and-encoding-json-v2)

Explore Go 1.27's encoding/json vs encoding/json/v2. Discover the stricter JSON handling in v2, enforcing spec compliance for invalid UTF-8, duplicate keys, and nil defaults. Upgrade your Go JSON parsing.

- Tags: deep-dive
- Published: 2026-08-30

### [How the `wg.Go` Pattern Differs from Manual WaitGroup Usage in Go 1.25](/jetbrains/go-modern-guidelines/wg-go-pattern-vs-manual-waitgroup-usage)

Discover how Go 1.25's wg.Go pattern simplifies goroutine management. Learn its advantages over manual WaitGroup usage for cleaner, safer code.

- Tags: deep-dive
- Published: 2026-08-30

### [How go-modern-guidelines Addresses Training Data Lag in AI Coding Agents](/jetbrains/go-modern-guidelines/how-tool-addresses-training-data-lag-ai-coding-agents)

Learn how JetBrains/go-modern-guidelines tackles training data lag in AI coding agents using version-aware filtering, conditional compilation, and fallback implementations for compatible Go features.

- Tags: how-to-guide
- Published: 2026-08-30

### [Go Version Requirements and Automatic Toolchain Switching in go-modern-guidelines](/jetbrains/go-modern-guidelines/go-version-requirement-and-toolchain-switching)

Discover go-modern-guidelines Go version requirements and how it uses GOTOOLCHAIN auto to switch toolchains. Learn about automatic toolchain switching.

- Tags: internals
- Published: 2026-08-30

### [How `make dev-install` Rebuilds Local Changes into the Agent's Cache](/jetbrains/go-modern-guidelines/how-make-dev-install-rebuilds-local-changes-agents-cache)

Understand how make dev-install rebuilds local changes into the agent cache. Test your modifications instantly with the GO_MODERN_GUIDELINES_DEV environment variable.

- Tags: how-to-guide
- Published: 2026-08-30

### [skills.sh Integration vs Native Cursor and Codex Plugins: A Technical Deep Dive](/jetbrains/go-modern-guidelines/skills-sh-integration-vs-native-plugin-integrations)

Compare skills.sh integration with native Cursor and Codex plugins. Understand the technical differences and choose the best approach for your AI development workflow.

- Tags: deep-dive
- Published: 2026-08-30

### [How to Configure Auto-Updates for the Claude Code Plugin Marketplace](/jetbrains/go-modern-guidelines/how-to-configure-auto-updates-claude-code-plugin-marketplace)

Easily configure auto-updates for the Claude Code plugin marketplace in JetBrains IDEs. Streamline your workflow by enabling automatic updates via the GUI or CLI.

- Tags: how-to-guide
- Published: 2026-08-30

### [Internal Architecture of the internal/cli Package in JetBrains/go-modern-guidelines](/jetbrains/go-modern-guidelines/internal-architecture-of-internal-cli-package)

Explore the internal architecture of the internal/cli package in JetBrains/go-modern-guidelines. Understand how it parses arguments, dispatches commands, and delegates resolution.

- Tags: internals
- Published: 2026-08-30

### [How go-modern-guidelines Ensures Backward Compatibility with Older Go Toolchain Versions](/jetbrains/go-modern-guidelines/how-tool-ensures-backward-compatibility-older-go-toolchain)

Learn how go-modern-guidelines ensures backward compatibility with older Go toolchain versions using its layered version resolution system for seamless legacy support.

- Tags: internals
- Published: 2026-08-30

### [How the `GO_MODERN_GUIDELINES_DEV` Environment Variable Enables Local Development](/jetbrains/go-modern-guidelines/how-go-modern-guidelines-dev-enables-local-development)

Understand how the GO_MODERN_GUIDELINES_DEV environment variable simplifies local development by switching to a local binary instead of a published release. Boost your workflow today.

- Tags: how-to-guide
- Published: 2026-08-30

### [How go-modern-guidelines Detects a Project's Go Version from go.mod](/jetbrains/go-modern-guidelines/how-does-go-modern-guidelines-detect-go-version-from-go-mod)

Learn how go-modern-guidelines detects your project's Go version by parsing the go directive from go.mod or go.work files. Understand the process step-by-step.

- Tags: how-to-guide
- Published: 2026-08-30

### [How to Use `t.Context()` in Go Tests for Better Context Management](/jetbrains/go-modern-guidelines/how-to-use-t-context-in-go-tests-for-better-context-management)

Learn to use t.Context() in Go tests for automatic cleanup. Ensure goroutines and requests cancel when tests end, simplifying your test code.

- Tags: how-to-guide
- Published: 2026-08-30

### [How `wg.Go` Simplifies Concurrent Operations Compared to `sync.WaitGroup.Add/Done`](/jetbrains/go-modern-guidelines/how-does-wg-go-simplify-concurrent-operations-compared-to-sync-waitgroup-add-done)

Discover how wg.Go simplifies concurrent operations by automatically managing Add and Done, preventing deadlocks and reducing boilerplate compared to sync WaitGroup.

- Tags: deep-dive
- Published: 2026-08-30

### [How to Use cmp.Or in Go for Default Value Chains](/jetbrains/go-modern-guidelines/what-is-the-purpose-of-cmp-or-in-go-for-default-value-chains)

Learn how to use cmp.Or in Go to simplify default value chains and eliminate verbose conditional blocks for configuration fallbacks and optional parameters.

- Tags: how-to-guide
- Published: 2026-08-30

### [How to Use `strings.CutPrefix` and `strings.CutSuffix` for Efficient String Manipulation in Go](/jetbrains/go-modern-guidelines/how-can-i-use-strings-cutprefix-and-strings-cutsuffix-for-string-manipulation-in-go)

Learn to efficiently manipulate strings in Go using strings.CutPrefix and strings.CutSuffix. Discover how these functions perform checks and trim simultaneously.

- Tags: how-to-guide
- Published: 2026-08-30

### [How to Find the Minimum or Maximum of Values in Modern Go](/jetbrains/go-modern-guidelines/what-is-the-modern-go-way-to-find-the-minimum-or-maximum-of-values)

Discover the modern Go way to find min or max values using slices.Min and slices.Max in Go 1.21+. Simplify your code and avoid manual loops.

- Tags: how-to-guide
- Published: 2026-08-30

### [When to Use `errors.Is` and `errors.As` Instead of Direct Error Equality in Go](/jetbrains/go-modern-guidelines/when-should-i-use-errors-is-and-errors-as-instead-of-direct-error-equality-in-go)

Learn when to use Go's errors.Is and errors.As for error checking over direct equality. Understand error wrapping and sentinel errors for robust Go code.

- Tags: best-practices
- Published: 2026-08-30

### [Modern Go Idiom for Replacing `for i := 0; i < n; i++` Loops](/jetbrains/go-modern-guidelines/what-is-the-modern-go-idiom-for-replacing-for-i-0-i-n-i-loops)

Discover the modern Go idiom for replacing for i := 0; i < n; i++ loops with Go 1.22's elegant range syntax. Simplify your code and clarify intent.

- Tags: best-practices
- Published: 2026-08-30

### [How to Replace Manual Search Loops with slices.Contains in Go](/jetbrains/go-modern-guidelines/how-do-i-replace-manual-search-loops-with-slices-contains-in-go)

Replace manual search loops with Go 1.21 slices Contains. Simplify slice value checks with this readable, single function call. Learn how to update your Go code.

- Tags: how-to-guide
- Published: 2026-08-30

### [Recommended Workflow for AI Agents Using the `list` and `explain` Commands in Go Modern Guidelines](/jetbrains/go-modern-guidelines/what-is-the-recommended-workflow-for-ai-agents-using-the-list-and-explain-commands)

Learn the AI agent workflow using Go Modern Guidelines list and explain commands. Discover identifiers, filter by version or path, and get detailed recommendations with code examples.

- Tags: how-to-guide
- Published: 2026-08-30

### [How AI Agents Integrate with the go-modern-guidelines Skill Package](/jetbrains/go-modern-guidelines/how-can-ai-agents-integrate-with-the-go-modern-guidelines-skill-package)

Learn how AI agents integrate with the go-modern-guidelines skill package. Install the CLI tool to get version-specific Go guidelines for informed code generation.

- Tags: how-to-guide
- Published: 2026-08-30

### [How the ListText Function Filters Guidelines by Target Go Version in JetBrains/go-modern-guidelines](/jetbrains/go-modern-guidelines/how-does-the-listtext-function-filter-guidelines-based-on-the-target-go-version)

Discover how the ListText function in JetBrains go modern guidelines filters guidelines by target Go version using semantic version comparison.

- Tags: internals
- Published: 2026-08-30

### [How Guidelines Data Is Embedded in the go-modern-guidelines CLI](/jetbrains/go-modern-guidelines/how-are-the-guidelines-data-embedded-into-the-go-modern-guidelines-cli)

Discover how go-modern-guidelines embeds its data as a compiled-in JSON asset. Learn how the CLI parses guideline definitions at startup for list and explain commands.

- Tags: internals
- Published: 2026-08-30

### [Go Version Formats Supported by the internal/goversion Module](/jetbrains/go-modern-guidelines/what-go-version-formats-does-the-internal-goversion-module-support)

Discover the Go version formats supported by JetBrains go-modern-guidelines internal/goversion module. Handle bare, prefixed, patch, and devel versions.

- Tags: api-reference
- Published: 2026-08-30

### [What Go Versions Are Supported by the go-modern-guidelines Database?](/jetbrains/go-modern-guidelines/what-go-versions-are-supported-by-the-go-modern-guidelines-database)

Discover which Go versions the go-modern-guidelines database supports. Ensure compatibility from Go 1.0 to 1.27 for all modern language features.

- Tags: api-reference
- Published: 2026-08-30

### [How to Get Detailed Explanations and Examples for Go Guideline IDs](/jetbrains/go-modern-guidelines/how-can-i-get-detailed-explanations-and-examples-for-specific-go-guideline-ids)

Learn how to get detailed explanations and examples for Go guideline IDs. Access the guidelines.json file, use the CLI, or import the package for full details.

- Tags: how-to-guide
- Published: 2026-08-30

### [How go-modern-guidelines Detects the Go Version Without Flags or File Paths](/jetbrains/go-modern-guidelines/how-does-the-cli-detect-the-go-version-if-no-explicit-flag-or-file-path-is-provided)

Discover how go-modern-guidelines automatically detects your Go version using go env GOVERSION, ensuring tailored coding guideline application without flags or file paths.

- Tags: internals
- Published: 2026-08-30

### [How to Override the Go Version When Listing Guidelines with the CLI](/jetbrains/go-modern-guidelines/how-do-i-override-the-go-version-when-listing-guidelines-with-the-cli)

Easily override the Go version for go-modern-guidelines list CLI checks. Use the go version flag to set your target Go version for precise linting.

- Tags: how-to-guide
- Published: 2026-08-30

### [How to List Go Modern Guidelines Using the CLI for a Specific File](/jetbrains/go-modern-guidelines/how-can-i-list-go-modern-guidelines-using-the-cli-for-a-specific-file)

Easily list Go modern guidelines for a specific file using the CLI. Run go-modern-guidelines list <path> to filter rules based on your file's Go version and module.

- Tags: how-to-guide
- Published: 2026-08-30

### [What Is the Default Target Go Version for the go-modern-guidelines CLI?](/jetbrains/go-modern-guidelines/what-is-the-default-target-go-version-for-the-go-modern-guidelines-cli)

Discover the default target Go version for the go-modern-guidelines CLI. Learn how it uses your local Go toolchain version when no flags are specified.

- Tags: faq
- Published: 2026-08-30

### [How to Install the go-modern-guidelines CLI and Where It Is Cached Locally](/jetbrains/go-modern-guidelines/how-is-the-go-modern-guidelines-cli-installed-and-where-is-it-cached-locally)

Learn how to install the go-modern-guidelines CLI using go install or IDE plugins and find its local cache location at XDG_CACHE_HOME go-modern-guidelines.

- Tags: how-to-guide
- Published: 2026-08-30

### [What Is the go-modern-guidelines CLI Tool? Purpose and AI Integration](/jetbrains/go-modern-guidelines/what-is-the-purpose-of-the-go-modern-guidelines-cli-tool)

Discover the go-modern-guidelines CLI tool, JetBrains' modern Go coding guidelines for AI-assisted development. Enable version-aware code generation with list and explain subcommands.

- Tags: how-to-guide
- Published: 2026-08-30

### [How JetBrains Go Modern Guidelines Help AI Code Agents Avoid Outdated Go Code](/jetbrains/go-modern-guidelines/how-do-jetbrains-go-modern-guidelines-help-ai-code-agents-avoid-outdated-go-code)

JetBrains Go Modern Guidelines enable AI code agents to avoid outdated Go code by filtering deprecated patterns with version-aware validation and providing current best practices.

- Tags: best-practices
- Published: 2026-08-30

### [Understanding `sync.OnceFunc` and `sync.OnceValue` in Go 1.21](/jetbrains/go-modern-guidelines/what-are-sync-oncefunc-and-sync-oncevalue-for-in-go-1-21)

Go 1.21 introduces sync.OnceFunc and sync.OnceValue to simplify thread-safe one-time initialization and memoization, reducing boilerplate code.

- Tags: deep-dive
- Published: 2026-08-29

### [How `sync.WaitGroup.Go()` Simplifies Goroutine Launching in Go 1.25](/jetbrains/go-modern-guidelines/how-does-sync-waitgroup-go-simplify-launching-goroutines-in-go-1-25)

Go 1.25's sync.WaitGroup.Go() simplifies goroutine launching. Learn how this helper automatically manages Add(1) and Done(), preventing bugs and reducing boilerplate.

- Tags: deep-dive
- Published: 2026-08-29

### [Modern Concurrency Patterns for Goroutines and Synchronization in Go](/jetbrains/go-modern-guidelines/what-are-the-modern-concurrency-patterns-for-goroutines-and-synchronization-in-go)

Explore modern concurrency patterns for goroutines and synchronization in Go. Discover declarative patterns like wg.Go, sync.OnceFunc, and typed atomics to replace legacy code with safer, self-documenting APIs.

- Tags: best-practices
- Published: 2026-08-29

### [How to Use the new(value) Syntax for Creating Pointers to Literals in Go 1.26](/jetbrains/go-modern-guidelines/what-is-the-new-value-syntax-for-creating-pointers-to-literals-in-go-1-26)

Learn the new Go 1.26 new(value) syntax to create pointers to literals. Eliminate temporary variables and simplify your code with this concise alternative to address-of literals.

- Tags: how-to-guide
- Published: 2026-08-29

### [Understanding errors.Join for Aggregating Errors in Go (Go 1.20+)](/jetbrains/go-modern-guidelines/what-is-the-purpose-of-errors-join-for-aggregating-errors-in-go)

Discover how errors Join aggregates multiple errors in Go 1.20+ preserving individual error inspection with errors Is and errors As for robust error handling.

- Tags: deep-dive
- Published: 2026-08-29

### [How `errors.As` Simplifies Error Handling with Specific Error Types in Go](/jetbrains/go-modern-guidelines/how-does-errors-as-simplify-error-handling-with-specific-error-types-in-go)

Learn how Go's errors.As simplifies error handling by replacing verbose type assertions with a type-safe check that traverses your error stack.

- Tags: deep-dive
- Published: 2026-08-29

### [When to Use `errors.Is` Versus Direct Error Comparison in Go](/jetbrains/go-modern-guidelines/when-should-i-use-errors-is-versus-direct-error-comparison-in-go)

Learn when to use errors Is versus direct error comparison in Go. Understand wrapped errors and sentinel errors for robust Go error handling.

- Tags: best-practices
- Published: 2026-08-29

### [Modern Go Error Handling Patterns: A Complete Guide to JetBrains' go-modern-guidelines](/jetbrains/go-modern-guidelines/what-are-the-modern-go-error-handling-patterns-recommended-by-go-modern-guidelines)

Discover modern Go error handling patterns with JetBrains go-modern-guidelines. Learn to use errors.Is, errors.As, errors.Join, and errors.AsType for safer, maintainable Go code.

- Tags: best-practices
- Published: 2026-08-29

### [How the `forvar` Guideline Prevents Loop Variable Shadowing in go-modern-guidelines](/jetbrains/go-modern-guidelines/how-does-the-forvar-guideline-in-go-modern-guidelines-address-loop-variable-shadowing)

Learn how the forvar guideline prevents loop variable shadowing in go-modern-guidelines by disallowing redundant declarations. Avoid subtle capture bugs and ensure variable accessibility.

- Tags: deep-dive
- Published: 2026-08-29

### [Go 1.22 Loop Improvements for Iterating Over Integers: Range Over N Syntax](/jetbrains/go-modern-guidelines/what-are-the-go-1-22-loop-improvements-for-iterating-over-integers)

Go 1.22 simplifies integer iteration with the new for i := range n syntax. Learn how to write cleaner loops and avoid boilerplate in your Go code.

- Tags: deep-dive
- Published: 2026-08-29

### [How to Clear a Slice or Map in Go Using the `clear` Built-In Function](/jetbrains/go-modern-guidelines/how-do-i-clear-a-slice-or-map-in-go-using-the-clear-built-in-function)

Learn how to clear a slice or map in Go with the new clear built-in function introduced in Go 1.21. This guide shows efficient map and slice manipulation.

- Tags: how-to-guide
- Published: 2026-08-29

### [How to Find the Maximum or Minimum of a Slice in Go](/jetbrains/go-modern-guidelines/what-are-the-modern-ways-to-find-the-maximum-or-minimum-of-a-slice-in-go)

Discover modern Go techniques to find the maximum or minimum of a slice using standard library functions like slices Max and Min. Learn custom comparison with MaxFunc and MinFunc.

- Tags: how-to-guide
- Published: 2026-08-29

### [How to Collect Map Keys or Values Using `maps.Keys` and `slices.Collect` in Go 1.23](/jetbrains/go-modern-guidelines/how-do-i-collect-keys-or-values-from-a-map-using-maps-keys-and-slices-collect-in-go-1-23)

Learn to collect Go map keys or values efficiently using maps.Keys and slices.Collect in Go 1.23. Avoid manual loops with these powerful standard library functions.

- Tags: how-to-guide
- Published: 2026-08-29

### [What Is the `maps.Clone` Function in Go 1.21?](/jetbrains/go-modern-guidelines/what-is-the-maps-clone-function-for-in-go-1-21)

Discover maps.Clone in Go 1.21 for efficient map cloning. This standard library function creates a shallow copy, simplifying your code by replacing manual loops.

- Tags: deep-dive
- Published: 2026-08-29

### [How to Sort a Slice in Go 1.21: The Modern Generic Approach](/jetbrains/go-modern-guidelines/what-is-the-modern-way-to-sort-a-slice-in-go-1-21)

Learn the modern Go 1.21 way to sort slices using generic slices.Sort and slices.SortFunc with cmp.Compare for efficient and flexible data ordering.

- Tags: how-to-guide
- Published: 2026-08-29

### [How to Use `slices.Contains` in Go: A Complete Guide to Generic Slice Search](/jetbrains/go-modern-guidelines/how-can-i-use-slices-contains-in-go)

Learn to use Go's slices.Contains for efficient, generic slice searching. Replace manual loops with this simple, powerful standard library function. Find elements fast.

- Tags: how-to-guide
- Published: 2026-08-29

### [Modern Go Collection Patterns for Slices and Maps: A Complete Go 1.21+ Guide](/jetbrains/go-modern-guidelines/what-are-the-modern-go-collection-patterns-for-slices-and-maps-introduced-in-go-1-21)

Discover modern Go collection patterns for slices and maps in Go 1.21+. Learn how to use new built-in functions to simplify your code and improve performance.

- Tags: deep-dive
- Published: 2026-08-29

### [Where Is the go-modern-guidelines CLI Installed by Agents?](/jetbrains/go-modern-guidelines/where-is-the-go-modern-guidelines-cli-installed-by-agents)

Discover where the go-modern-guidelines CLI installs on your system. Learn it's located in a per-user cache directory, not a global binary, for efficient management.

- Tags: how-to-guide
- Published: 2026-08-29

### [How the go-modern-guidelines Repository Is Structured: A Complete Technical Guide](/jetbrains/go-modern-guidelines/how-is-the-go-modern-guidelines-repository-structured)

Explore the structure of the go-modern-guidelines repository. Discover how CLI, guideline data, and Go version resolution are organized for a clear, purpose-driven architecture. Learn more today.

- Tags: technical-guide
- Published: 2026-08-29

### [Which AI Coding Agents Integrate with go-modern-guidelines: Complete Integration Guide](/jetbrains/go-modern-guidelines/which-ai-coding-agents-integrate-with-go-modern-guidelines)

Discover which AI coding agents integrate with go-modern-guidelines. Learn how to connect Junie, Claude Code, Codex, Cursor, OpenCode, and more using the skills.sh endpoint.

- Tags: getting-started
- Published: 2026-08-29

### [What Go Versions Are Covered by go‑modern‑guidelines? A Complete Guide](/jetbrains/go-modern-guidelines/what-go-versions-are-covered-by-go-modern-guidelines)

Discover which Go versions go-modern-guidelines supports. Learn about Go 1.0 through 1.27 coverage and CLI tool requirements. Get the complete guide now.

- Tags: getting-started
- Published: 2026-08-29

### [How go-modern-guidelines Helps AI Coding Agents Write Better Go Code: A Technical Deep Dive](/jetbrains/go-modern-guidelines/how-does-go-modern-guidelines-help-ai-coding-agents-write-better-go-code)

Discover how go-modern-guidelines empowers AI coding agents to write superior Go code. Learn about its CLI tool and JSON knowledge base for real-time idiom checks.

- Tags: deep-dive
- Published: 2026-08-29

