Skip to content

Fix staticcheck in generated code #1424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 12, 2025
Merged

Fix staticcheck in generated code #1424

merged 2 commits into from
Mar 12, 2025

Conversation

AlphaOne1
Copy link
Contributor

The generated router uses a variable - origElem - to save the elem variable while potentially modifying it. This elem is used after in some cases. If it is not used, the staticcheck complains about setting a variable without further use. This patch removes the origElem save in cases where elem is not used afterwards, fixing the staticcheck.

The saving of elem in origElem is not needed in all cases.
staticcheck finds those cases and complains.
This fix removes the saves in cases where they are not
needed afterwards.
@AlphaOne1
Copy link
Contributor Author

I fixed the commit message that the pipeline complained in the previous pull request.

@tdakkota tdakkota merged commit 1d7ac80 into ogen-go:main Mar 12, 2025
15 checks passed
@AlphaOne1 AlphaOne1 changed the title Fix staticcheck in generated Fix staticcheck in generated code Mar 14, 2025
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.

2 participants