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

bytescomparestring

package
v0.82.7 Latest Latest
Warning

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

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

Documentation

Overview

Package bytescomparestring implements a Go analysis linter that flags string(a) == string(b) and string(a) != string(b) comparisons where both a and b are []byte values, which should use bytes.Equal(a, b) instead to avoid unnecessary allocations.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:     "bytescomparestring",
	Doc:      "reports string(a) == string(b) and string(a) != string(b) comparisons where a and b are []byte values that should use bytes.Equal instead",
	URL:      "https://github.com/github/gh-aw/tree/main/pkg/linters/bytescomparestring",
	Requires: []*analysis.Analyzer{inspect.Analyzer},
	Run:      run,
}

Analyzer is the bytes-compare-string 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