Skip to content

Commit

Permalink
Silence some TestGolint warnings for the error library.
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
knz committed Jun 4, 2019
1 parent e9027e0 commit 2750e62
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/testutils/lint/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2750e62

Please sign in to comment.