From af7b6728affb643ac4b5d62390ba8d01b59c3f4c Mon Sep 17 00:00:00 2001 From: Penthaa Patel Date: Fri, 15 Oct 2021 17:39:17 +0530 Subject: [PATCH] analyzer/testdata: use || in rules.go (#283) Fixes #273 Signed-off-by: Penthaa Patel --- analyzer/testdata/src/gocritic/rules.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/analyzer/testdata/src/gocritic/rules.go b/analyzer/testdata/src/gocritic/rules.go index 5fdafe5c..b88ddd6a 100644 --- a/analyzer/testdata/src/gocritic/rules.go +++ b/analyzer/testdata/src/gocritic/rules.go @@ -79,13 +79,8 @@ func testRules(m dsl.Matcher) { Where(m["arr"].Type.Is(`*[$_]$_`)). Report(`explicit array deref is redundant`) - // Can factor into a single rule when || operator - // is supported in filters. m.Match(`$s[:]`). - Where(m["s"].Type.Is(`string`)). - Report(`can simplify $$ to $s`) - m.Match(`$s[:]`). - Where(m["s"].Type.Is(`[]$_`)). + Where(m["s"].Type.Is(`string`) || m["s"].Type.Is(`[]$_`)). Report(`can simplify $$ to $s`) m.Match(`switch $_ {case $_: $*_}`,