@@ -157,15 +157,8 @@ func (checker BoolCompare) Check(pass *analysis.Pass, call *CallMeta) *analysis.
157
157
arg1 , ok1 := isComparisonWithTrue (pass , expr , token .EQL )
158
158
arg2 , ok2 := isComparisonWithFalse (pass , expr , token .NEQ )
159
159
160
- if anyCondSatisfaction (pass , isEmptyInterface , arg1 , arg2 ) {
161
- return nil
162
- }
163
- if anyCondSatisfaction (pass , isBoolOverride , arg1 , arg2 ) {
164
- return nil
165
- }
166
-
167
160
survivingArg , ok := anyVal ([]bool {ok1 , ok2 }, arg1 , arg2 )
168
- if ok {
161
+ if ok && ! isEmptyInterface ( pass , survivingArg ) {
169
162
return newNeedSimplifyDiagnostic (survivingArg , expr .Pos (), expr .End ())
170
163
}
171
164
}
@@ -175,15 +168,8 @@ func (checker BoolCompare) Check(pass *analysis.Pass, call *CallMeta) *analysis.
175
168
arg2 , ok2 := isComparisonWithFalse (pass , expr , token .EQL )
176
169
arg3 , ok3 := isNegation (expr )
177
170
178
- if anyCondSatisfaction (pass , isEmptyInterface , arg1 , arg2 , arg3 ) {
179
- return nil
180
- }
181
- if anyCondSatisfaction (pass , isBoolOverride , arg1 , arg2 , arg3 ) {
182
- return nil
183
- }
184
-
185
171
survivingArg , ok := anyVal ([]bool {ok1 , ok2 , ok3 }, arg1 , arg2 , arg3 )
186
- if ok {
172
+ if ok && ! isEmptyInterface ( pass , survivingArg ) {
187
173
return newUseFalseDiagnostic (survivingArg , expr .Pos (), expr .End ())
188
174
}
189
175
}
@@ -198,15 +184,8 @@ func (checker BoolCompare) Check(pass *analysis.Pass, call *CallMeta) *analysis.
198
184
arg1 , ok1 := isComparisonWithTrue (pass , expr , token .EQL )
199
185
arg2 , ok2 := isComparisonWithFalse (pass , expr , token .NEQ )
200
186
201
- if anyCondSatisfaction (pass , isEmptyInterface , arg1 , arg2 ) {
202
- return nil
203
- }
204
- if anyCondSatisfaction (pass , isBoolOverride , arg1 , arg2 ) {
205
- return nil
206
- }
207
-
208
187
survivingArg , ok := anyVal ([]bool {ok1 , ok2 }, arg1 , arg2 )
209
- if ok {
188
+ if ok && ! isEmptyInterface ( pass , survivingArg ) {
210
189
return newNeedSimplifyDiagnostic (survivingArg , expr .Pos (), expr .End ())
211
190
}
212
191
}
@@ -216,15 +195,8 @@ func (checker BoolCompare) Check(pass *analysis.Pass, call *CallMeta) *analysis.
216
195
arg2 , ok2 := isComparisonWithFalse (pass , expr , token .EQL )
217
196
arg3 , ok3 := isNegation (expr )
218
197
219
- if anyCondSatisfaction (pass , isEmptyInterface , arg1 , arg2 , arg3 ) {
220
- return nil
221
- }
222
- if anyCondSatisfaction (pass , isBoolOverride , arg1 , arg2 , arg3 ) {
223
- return nil
224
- }
225
-
226
198
survivingArg , ok := anyVal ([]bool {ok1 , ok2 , ok3 }, arg1 , arg2 , arg3 )
227
- if ok {
199
+ if ok && ! isEmptyInterface ( pass , survivingArg ) {
228
200
return newUseTrueDiagnostic (survivingArg , expr .Pos (), expr .End ())
229
201
}
230
202
}
0 commit comments