diff --git a/pkg/testutils/lint/lint_test.go b/pkg/testutils/lint/lint_test.go index 3475c5ffd49d..9d1eaac7fece 100644 --- a/pkg/testutils/lint/lint_test.go +++ b/pkg/testutils/lint/lint_test.go @@ -1421,6 +1421,13 @@ func TestLint(t *testing.T) { stream.GrepNot("sql/.*exported func .* returns unexported type sql.planNode"), stream.GrepNot("struct field (XXX_NoUnkeyedLiteral|XXX_sizecache) should be"), stream.GrepNot("pkg/sql/types/types.go.* var Uuid should be UUID"), + // The error library is made of composable bits that are not + // meant to be used further than the public interface, so + // these linter checks are irrelevant. + stream.GrepNot(`pkg/errors/.*/.*\.go:.* func name will be used as .* and that stutters`), + // It's OK to list a function type when forwarding a function definition, + // it helps with reading the code. + stream.GrepNot(`pkg/errors/.*\.go:.* should omit type func.* from declaration .* it will be inferred`), ), func(s string) { t.Errorf("\n%s", s) }); err != nil { @@ -1468,6 +1475,8 @@ func TestLint(t *testing.T) { stream.GrepNot(`pkg/sql/pgwire/pgerror/codes.go:.* const Code.* is unused`), // The methods in exprgen.customFuncs are used via reflection. stream.GrepNot(`pkg/sql/opt/optgen/exprgen/custom_funcs.go:.* func .* is unused`), + // The API forwards in the errors package are declared for documentation purposes. + stream.GrepNot(`pkg/errors/.*_api.go:.* is unused`), ), func(s string) { t.Errorf("\n%s", s) }); err != nil {