Skip to content

Commit af7b672

Browse files
authored
analyzer/testdata: use || in rules.go (#283)
Fixes #273 Signed-off-by: Penthaa Patel <[email protected]>
1 parent 451d089 commit af7b672

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

analyzer/testdata/src/gocritic/rules.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,8 @@ func testRules(m dsl.Matcher) {
7979
Where(m["arr"].Type.Is(`*[$_]$_`)).
8080
Report(`explicit array deref is redundant`)
8181

82-
// Can factor into a single rule when || operator
83-
// is supported in filters.
8482
m.Match(`$s[:]`).
85-
Where(m["s"].Type.Is(`string`)).
86-
Report(`can simplify $$ to $s`)
87-
m.Match(`$s[:]`).
88-
Where(m["s"].Type.Is(`[]$_`)).
83+
Where(m["s"].Type.Is(`string`) || m["s"].Type.Is(`[]$_`)).
8984
Report(`can simplify $$ to $s`)
9085

9186
m.Match(`switch $_ {case $_: $*_}`,

0 commit comments

Comments
 (0)