Fix linter (#16058)

Fix linter, otherwise #16049 fails the linter.
This commit is contained in:
Potuz
2025-11-26 12:03:26 -03:00
committed by GitHub
parent 4da6c4291f
commit a466c6db9c
2 changed files with 6 additions and 0 deletions

View File

@@ -525,6 +525,9 @@ func hasNestedlock(fullRLockSelector *selIdentList, goPos token.Pos, compareMap
if node == (*ast.FuncDecl)(nil) {
return ""
} else if castedNode, ok := node.(*ast.FuncDecl); ok && castedNode.Recv != nil {
if len(castedNode.Recv.List) == 0 || len(castedNode.Recv.List[0].Names) == 0 {
return ""
}
recv = castedNode.Recv.List[0].Names[0]
rLockSelector.changeRoot(recv, pass.TypesInfo.ObjectOf(recv))
}