@@ -288,18 +288,18 @@ func switchComparesNonNil(switchStmt *ast.SwitchStmt) bool {
288
288
return false
289
289
}
290
290
291
- func LintErrorTypeAssertions (fset * token.FileSet , info types. Info ) []analysis.Diagnostic {
291
+ func LintErrorTypeAssertions (fset * token.FileSet , info * TypesInfoExt ) []analysis.Diagnostic {
292
292
lints := []analysis.Diagnostic {}
293
293
294
- for expr := range info .Types {
294
+ for expr := range info .TypesInfo . Types {
295
295
// Find type assertions.
296
296
typeAssert , ok := expr .(* ast.TypeAssertExpr )
297
297
if ! ok {
298
298
continue
299
299
}
300
300
301
301
// Find type assertions that operate on values of type error.
302
- if ! isErrorTypeAssertion (info , typeAssert ) {
302
+ if ! isErrorTypeAssertion (* info . TypesInfo , typeAssert ) {
303
303
continue
304
304
}
305
305
@@ -309,7 +309,7 @@ func LintErrorTypeAssertions(fset *token.FileSet, info types.Info) []analysis.Di
309
309
})
310
310
}
311
311
312
- for scope := range info .Scopes {
312
+ for scope := range info .TypesInfo . Scopes {
313
313
// Find type switches.
314
314
typeSwitch , ok := scope .(* ast.TypeSwitchStmt )
315
315
if ! ok {
@@ -326,7 +326,7 @@ func LintErrorTypeAssertions(fset *token.FileSet, info types.Info) []analysis.Di
326
326
}
327
327
328
328
// Check whether the type switch is on a value of type error.
329
- if ! isErrorTypeAssertion (info , typeAssert ) {
329
+ if ! isErrorTypeAssertion (* info . TypesInfo , typeAssert ) {
330
330
continue
331
331
}
332
332
0 commit comments