diff options
Diffstat (limited to 'tools/checklocks/checklocks.go')
-rw-r--r-- | tools/checklocks/checklocks.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/checklocks/checklocks.go b/tools/checklocks/checklocks.go index 180f8873f..401fb55ec 100644 --- a/tools/checklocks/checklocks.go +++ b/tools/checklocks/checklocks.go @@ -90,12 +90,14 @@ func run(pass *analysis.Pass) (interface{}, error) { // Find all struct declarations and export relevant facts. pc.forAllTypes(func(ts *ast.TypeSpec) { if ss, ok := ts.Type.(*ast.StructType); ok { - pc.exportLockFieldFacts(ts, ss) + structType := pc.pass.TypesInfo.TypeOf(ts.Name).Underlying().(*types.Struct) + pc.exportLockFieldFacts(structType, ss) } }) pc.forAllTypes(func(ts *ast.TypeSpec) { if ss, ok := ts.Type.(*ast.StructType); ok { - pc.exportLockGuardFacts(ts, ss) + structType := pc.pass.TypesInfo.TypeOf(ts.Name).Underlying().(*types.Struct) + pc.exportLockGuardFacts(structType, ss) } }) |