File tree Expand file tree Collapse file tree 1 file changed +0
-13
lines changed Expand file tree Collapse file tree 1 file changed +0
-13
lines changed Original file line number Diff line number Diff line change @@ -94,19 +94,6 @@ func (r *readfile) trackFilepathClean(n ast.Node) {
9494 }
9595}
9696
97- // trackJoin records when a Join() call result is assigned to an identifier
98- // example: fullPath := filepath.Join(baseDir, cleanPath)
99- func (r * readfile ) trackJoin (n ast.Node ) {
100- // n is expected to be a *ast.CallExpr (Join(...)) but the assignment is a different node.
101- // We will look for an enclosing AssignStmt if provided (the caller passes n which is the call)
102- if joinCall , ok := n .(* ast.CallExpr ); ok && len (joinCall .Args ) > 0 {
103- // We don't have direct access to the enclosing assignment here (since Match receives call exprs),
104- // so the practical approach is: when Match sees a Join call used in an assignment, it should call this helper
105- // with the assignment node. For simplicity, we will expect the caller to pass an AssignStmt.
106- _ = joinCall // caller should call trackJoin on the AssignStmt (see Match where we call it)
107- }
108- }
109-
11097// trackJoinAssignStmt tracks assignments where RHS is a Join(...) call and LHS is an identifier
11198func (r * readfile ) trackJoinAssignStmt (node * ast.AssignStmt , c * gosec.Context ) {
11299 if len (node .Rhs ) == 0 {
You can’t perform that action at this time.
0 commit comments