GoLand 2026.2 Help

Modern Go Guidelines

Purpose

AI coding agents can select outdated Go patterns. Their training data might not include features that were added after the model's knowledge cutoff. Even when an agent knows a newer pattern, it can choose an older pattern that appears more often in training data.

Modern Go Guidelines provides a reference for language features and standard library APIs.

Go version support

The agent reads the Go version declared in your project's go.mod file. It receives guidance only for features that are available in that version.

For example, an agent working in a project that uses Go 1.25 can use sync.WaitGroup.Go. It does not receive guidance for errors.AsType, which requires Go 1.26.

Guideline lookup

Modern Go Guidelines includes a command-line tool with the list and explain subcommands. The agent uses the tool through the installed skill.

Before it edits a Go file, the agent calls list for that file. The command returns short guidelines that apply to the Go version in your project:

go-modern-guidelines list --file-path ./internal/worker/worker.go

The agent can also specify a Go version directly:

go-modern-guidelines list --go-version 1.27

The output starts with the newest applicable guidelines. Each guideline has a stable ID:

sync_waitgroup_go: Use wg.Go when spawning goroutines tracked by a sync.WaitGroup. testing_t_context: Use t.Context() when a test function needs a context tied to the test lifetime. json_omitzero: Use omitzero on JSON-tagged bool, numeric, struct, and time fields whose zero value should be omitted.

When the agent needs more information about a guideline, it calls explain with the guideline ID. The command returns a description and before-and-after examples:

go-modern-guidelines explain sync_waitgroup_go

This workflow limits the guidance to the information that applies to the task.

Guideline content

Modern Go Guidelines cover useful language features and standard library additions from Go 1.0 through Go 1.27. They also include patterns covered by the Go modernize analyzer.

The guidelines help an agent use modern patterns, such as:

  • slices.Contains instead of a manual search loop.

  • min and max instead of handwritten comparisons.

  • cmp.Or instead of a chain that selects the first nonzero value.

  • sync.WaitGroup.Go instead of separate Add, go, and Done calls.

For example, a guideline for Go 1.25 or later can replace manual WaitGroup bookkeeping:

var wg sync.WaitGroup wg.Add(1) go func() { defer wg.Done() process() }() wg.Wait()
var wg sync.WaitGroup wg.Go(func() { process() }) wg.Wait()

WaitGroup.Go starts the goroutine and manages the matching Add and Done calls. The agent uses this pattern when the goroutine lifetime matches the WaitGroup lifetime.

Install Modern Go Guidelines

Modern Go Guidelines is available for Junie, Claude Code, Codex, Cursor, and other coding agents that support skills.

Install the Go toolchain and make it available on your PATH. On first use, the integration installs its command-line tool in a local cache. It does not modify your project.

Install from a marketplace

  • Add the Modern Go Guidelines repository as a marketplace.

    In a Claude Code session, run:

    /plugin marketplace add JetBrains/go-modern-guidelines

    In a terminal, run:

    codex plugin marketplace add JetBrains/go-modern-guidelines
  • Install the plugin from the marketplace.

    /plugin install modern-go-guidelines@goland-claude-marketplace
    codex plugin add modern-go-guidelines@goland-codex-marketplace
  • Start or restart the agent in your Go project. The agent uses the installed skill when it works with Go code.

Install from a local repository

  • Get a local copy of the Modern Go Guidelines repository. Use this method to test changes before you publish them.

  • Check that the repository contains the marketplace definition for your agent.

    The repository root must contain .claude-plugin/marketplace.json.

    The repository root must contain .agents/plugins/marketplace.json.

  • Add the local repository as a marketplace. Replace the example path with the absolute path to your repository.

    claude plugin marketplace add /absolute/path/to/go-modern-guidelines
    codex plugin marketplace add /absolute/path/to/go-modern-guidelines
  • Install the plugin from the local marketplace.

    claude plugin install modern-go-guidelines@goland-claude-marketplace
    codex plugin add modern-go-guidelines@goland-codex-marketplace
  • Start or restart the agent in your Go project.

For Junie, Cursor, other agents, and update instructions, see the Modern Go Guidelines repository.

Update existing Go code

Modern Go Guidelines apply to new code. To find and update outdated code that is already in your project, use the Go syntax update inspections.

17 September 2026