go-tools icon indicating copy to clipboard operation
go-tools copied to clipboard

ST1020: ignore deprecation comment

Open leitzler opened this issue 2 years ago • 0 comments

As ST1020 is opt-in I would expect it to be ignored if the only comment on an exported function is a deprecation message:

% txtar-c .
-- foo.go --
package foo

// Deprecated: Use bar instead
func Foo() {
}
-- go.mod --
module x

go 1.21
% staticcheck -checks=ST1020 .
foo.go:3:1: comment on exported function Foo should be of the form "Foo ..." (ST1020)

leitzler avatar Mar 02 '23 08:03 leitzler