Help us shape the future of Go! Take the 2026 Go Developer Survey

stringsconcatloop

package
v0.91.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package stringsconcatloop implements a Go analysis linter that flags string concatenation inside for/range loop bodies using += or the equivalent x = x + y form, which allocates a new string on every iteration and can lead to O(n²) total allocated bytes. The idiomatic fix is to use strings.Builder.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = analyzerutil.New("stringsconcatloop", "reports string concatenation (+=  or x = x + y) inside for/range loops that should use strings.Builder", run)

Analyzer is the string-concat-in-loop analysis pass.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL