https://github.com/tklauser/lintcomparestrings
Go linter to check for uses of cmp.Compare with string arguments
https://github.com/tklauser/lintcomparestrings
Last synced: 9 months ago
JSON representation
Go linter to check for uses of cmp.Compare with string arguments
- Host: GitHub
- URL: https://github.com/tklauser/lintcomparestrings
- Owner: tklauser
- License: bsd-3-clause
- Created: 2025-01-10T15:08:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-06T11:30:58.000Z (about 1 year ago)
- Last Synced: 2025-05-06T12:49:52.920Z (about 1 year ago)
- Language: Go
- Homepage:
- Size: 50.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lintcomparestrings
A Go linter which checks whether the more efficient
[`strings.Compare`](https://pkg.go.dev/strings#Compare) three-way-compare
function is used for strings rather than [`cmp.Compare`](https://pkg.go.dev/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