Skip to content

[gosrc2cpg] Add defer/go/select/send statements, fix fallthrough and tuple returns#5908

Open
allsmog wants to merge 1 commit intojoernio:masterfrom
allsmog:go/add-concurrency-stmts-and-tuple-returns
Open

[gosrc2cpg] Add defer/go/select/send statements, fix fallthrough and tuple returns#5908
allsmog wants to merge 1 commit intojoernio:masterfrom
allsmog:go/add-concurrency-stmts-and-tuple-returns

Conversation

@allsmog
Copy link
Copy Markdown

@allsmog allsmog commented Mar 30, 2026

Adds support for Go concurrency constructs and fixes tuple return types.

  • Add DeferStmt, GoStmt, SelectStmt, SendStmt, CommClause parser node types and handlers
  • Fix fallthrough to produce proper control structure node instead of empty AST
  • Fix tuple return types to correctly represent (type1, type2) instead of only first type
  • Remove resolved TODO comments

Test plan

  • New ConcurrencyTests: 6 tests for defer, go, send, select
  • Un-ignored and updated SwitchTests fallthrough test
  • Un-ignored and updated MethodTests tuple return test + new test
  • All existing gosrc2cpg tests pass

…tuple returns

- Add DeferStmt, GoStmt, SelectStmt, SendStmt, CommClause parser node types
- Add handler methods for all 5 new statement types
- Fix fallthrough to produce proper control structure node
- Fix tuple return types to correctly represent (type1, type2)
- Remove stale TODO comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant