GoLand 2026.3 Help

Analyze code for syntax updates with go fix

GoLand provides inspections based on go fix. These inspections help you update code for language and standard library changes introduced in later Go versions.

The Go toolchain analyzes your code. GoLand displays the results as inspections in the editor. Each inspection identifies an outdated construct. Inspections that support automatic updates provide a quick-fix.

Apply a syntax update in the editor

GoLand highlights syntax updates with a blue underline and the syntax update icon (Syntax update icon).

Apply a syntax update

  1. Place the caret at a highlighted code element.

  2. Click the light bulb icon or press Alt+Enter.

  3. Select the quick-fix, then press Enter or click the quick-fix.

If a finding has no quick-fix, press Alt+Enter and select Inspection 'go fix -<pass>' options to configure, suppress, or disable the inspection. Here, <pass> is the name of the Go analyzer that reported the finding.

For more information about quick-fixes, refer to Intention actions.

Analyze code for additional syntax updates

After you apply a syntax update, GoLand displays the Analyze code for other syntax updates link in the editor.

Analyze code for additional syntax updates

  1. Click Analyze code for other syntax updates.

  2. In the Specify Syntax Update Scope dialog, select Whole project, the current file, or Custom scope.

  3. Click Analyze.

GoLand displays the results in the Problems tool window under Go | Go fix.

Review and apply syntax updates

In the Problems tool window, select an inspection to review its description, affected files, and available quick-fix.

Apply syntax update quick-fixes

  • To update one occurrence, expand the inspection and file nodes, select the occurrence, and click Apply Fix.

  • To update all occurrences in an inspection group, select the group and click Apply Fixes.

Run an inspection in another scope

  1. In the inspection details, click Run inspection on

  2. In the inspection scope dialog, select the whole project or a custom scope.

    To include code injected into strings, select Inspect injected code.

  3. Click OK.

Apply syntax updates on commit

You can apply go fix suggestions automatically before committing Go files. This check is disabled by default.

Enable go fix on commit

  1. Press Alt+0 to open the Commit tool window and click Show Commit Options the Settings button.

  2. Select Run go fix. If Go fmt is also selected, GoLand applies syntax updates before formatting.

The check analyzes your current code, including unsaved changes, and modifies only files included in the commit. If a suggestion also changes a file outside the commit, GoLand skips the whole suggestion. Vendored packages and packages outside the project content are skipped.

Configure syntax update inspections

Go fix inspections use the Syntax updates severity and the Go syntax update highlighting style by default.

Configure syntax update inspections

  1. Open settings by pressing Ctrl+Alt+S and navigate to Editor | Inspections.

  2. Expand Go | Go fix.

  3. Select an inspection. To configure all Go fix inspections at once, select the Go fix group.

  4. Select a value from the Severity list.

  5. Select a value from the Highlighting in editor list.

  6. Apply the changes and close the dialog.

22 September 2026