Inspectopedia 2026.2 Help

String concatenation can use 'strings.Builder'

Reports index-based loops over standard library types where the loop body only accesses elements by index, such as x.At(i).

Some standard library types now provide iterator methods, which let you range over the elements directly. This removes index arithmetic and makes the loop intent clearer.

Example:

func Join(parts []string, sep string) string { var out string for i, p := range parts { if i > 0 { out += sep } out += p } return out }

To fix the code, use the Replace string += string with strings.Builder quick-fix.

After the quick-fix is applied:

func Join(parts []string, sep string) string { var out strings.Builder for i, p := range parts { if i > 0 { out.WriteString(sep) } out.WriteString(p) } return out.String() }

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

GoFixStringsBuilder
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | Go | Go fix

Inspection ID: GoFixStringsBuilder

Suppressing Inspection

You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:

//noinspection GoFixStringsBuilder

More detailed instructions as well as other ways and options that you have can be found in the product documentation:

Inspection Details

By default bundled with:

GoLand 2026.2, Qodana for Go 2026.2,

Last modified: 30 June 2026