Currently there are niceities that go vet and revive do not have that staticcheck provides, primarily finding and reporting on Deprecated features.
Describe the solution you'd like
Given a function/feature has been deprecated
When CI is run
Thenstaticcheck fails on deprecated usages of that feature
Example:
// First30Last30 returns the source string that has been trimmed to 30 characters at the beginning and end.
func First30Last30(s string) string {
if len(s) > 60 {
return s[0:27] + "..." + s[len(s)-26:]
}
return s
}
// First30last30 returns the source string that has been trimmed to 30 characters at the beginning and end.
//
// Deprecated: Use First30Last30 instead.
func First30last30(s string) string {
return First30Last30(s)
}
First30last30 should be named First30Last30. In VSCode with the Go extension, staticcheck properly reports the deprecated usage.
❯ staticcheck
main.go:12:12: helpers.First30last30 is deprecated: Use First30Last30 instead. (SA1019)
Is your feature request related to a problem? Please describe.
https://staticcheck.dev/
Currently there are niceities that
go vet
andrevive
do not have thatstaticcheck
provides, primarily finding and reporting onDeprecated
features.Describe the solution you'd like
staticcheck
fails on deprecated usages of that featureExample:
First30last30
should be namedFirst30Last30
. In VSCode with the Go extension,staticcheck
properly reports the deprecated usage.