Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Go linter to check for uses of cmp.Compare with string arguments

License

Notifications You must be signed in to change notification settings

tklauser/lintcomparestrings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Go linter to check for uses of cmp.Compare with string arguments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 2

  •  
  •  

Languages