stringsconcatloop

package
v0.85.4 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 9 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