stringsconcatloop

package
v0.83.3 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package stringsconcatloop implements a Go analysis linter that flags string += concatenation inside for/range loop bodies, 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 = &analysis.Analyzer{
	Name:     "stringsconcatloop",
	Doc:      "reports string += concatenation inside for/range loops that should use strings.Builder",
	URL:      "https://github.com/github/gh-aw/tree/main/pkg/linters/stringsconcatloop",
	Requires: []*analysis.Analyzer{inspect.Analyzer, nolint.Analyzer, filecheck.Analyzer},
	Run:      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