Open
Conversation
alexandre-daubois
approved these changes
Apr 23, 2026
Member
alexandre-daubois
left a comment
There was a problem hiding this comment.
I didn't know that. Thanks!
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the internal/extgen parsing pipeline to preserve both parsing/scanning errors and Close() errors by switching deferred file-closing logic to errors.Join(), and adjusts related tests’ temp-file cleanup assertions.
Changes:
- Replace deferred
Close()error handling witherrors.Join()in several extgen parsers. - Remove
fmt.Printf-based close-error logging (namespace parser) in favor of error propagation. - Simplify test cleanup by using
require.NoErrorfor temp-file removal and removing an unusedassertimport.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/extgen/nsparser.go | Attempts to join Close() errors with existing errors (currently ineffective due to unnamed return / returning scanner.Err() directly). |
| internal/extgen/funcparser.go | Uses errors.Join() in deferred Close() to preserve both parse and close errors. |
| internal/extgen/constparser.go | Uses errors.Join() in deferred Close() to preserve both parse and close errors. |
| internal/extgen/classparser.go | Uses errors.Join() in deferred Close() to preserve both parse and close errors in method parsing. |
| internal/extgen/namespace_test.go | Uses require for cleanup and removes unused assert import. |
| internal/extgen/cfile_namespace_test.go | Uses require for cleanup in the temp-file test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Superseeds #2351.
Use
errors.Join()to preserve all errors in extgen.