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.
Click to show internal directories.
Click to hide internal directories.