lintcomparestrings

command module
v0.0.0-...-7bc2226 Latest Latest
Warning

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

Go to latest
Published: May 8, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

README

lintcomparestrings

A Go linter which checks whether the more efficient strings.Compare three-way-compare function is used for strings rather than cmp.Compare.

Using strings.Compare to three-way-compare strings is more efficient than cmp.Compare since Go 1.23, especially for large strings. See https://go.dev/issues/61725 and https://go.dev/cl/532195 for details.

Note that this linter will become obsolete once https://go.dev/issues/71270 is implemented.

Installation

go install github.com/tklauser/lintcomparestrings@latest

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package comparestrings defines an Analyzer that checks for calls to cmp.Compare that have string arguments and should use strings.Compare instead.
Package comparestrings defines an Analyzer that checks for calls to cmp.Compare that have string arguments and should use strings.Compare instead.

Jump to

Keyboard shortcuts

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