fix(protoc-gen-http-swagger): resolve staticcheck lint errors#19
Merged
GuangmingLuo merged 6 commits intohertz-contrib:mainfrom Apr 22, 2026
Merged
fix(protoc-gen-http-swagger): resolve staticcheck lint errors#19GuangmingLuo merged 6 commits intohertz-contrib:mainfrom
GuangmingLuo merged 6 commits intohertz-contrib:mainfrom
Conversation
Change-Id: I66e1255a65d225e23825d7ff37ece414e69a5b01
Change-Id: Ia640d4b7b057cf41c6cabc806c2d5fbe19f95cd6
Change-Id: I843a281a1e8b9df500ba02ce1c41ab680ca20924
Change-Id: I39edcd0b5499011ddf71da0ccc3d7f2ae4065a85
Fix the same staticcheck issues that were addressed in protoc-gen-rpc-swagger but missed in protoc-gen-http-swagger: - QF1003: use tagged switch instead of if/else-if chain - SA4001: remove redundant *& dereference Signed-off-by: spencercjh <spencercjh@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses staticcheck findings across the Swagger generators and updates CI linting to run staticcheck consistently.
Changes:
- Refactors conditional chains into tagged
switchstatements to satisfy staticcheck QF1003. - Removes redundant
*&dereference to satisfy staticcheck SA4001. - Updates GolangCI-Lint configuration and the PR-check GitHub Actions workflow (checkout/action versions, runner image, lint args).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| thrift-gen-http-swagger/generator/openapi_gen.go | Replaces if/else chain with tagged switch when selecting document options. |
| protoc-gen-rpc-swagger/generator/reflector.go | Uses tagged switch for well-known message naming and removes redundant dereference for enum schema generation. |
| protoc-gen-http-swagger/generator/reflector.go | Same staticcheck-driven refactors as rpc-swagger reflector. |
| .golangci.yaml | Migrates to a v2 config layout, explicitly enabling a smaller linter set including staticcheck. |
| .github/workflows/pr-check.yml | Moves PR checks to ubuntu-latest, bumps action versions, and updates golangci-lint invocation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
GuangmingLuo
approved these changes
Apr 22, 2026
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.
What type of PR is this?
fix
Check the PR title.
(Optional) Translate the PR title into Chinese.
fix(protoc-gen-http-swagger): 修复 staticcheck lint 错误
(Optional) More detailed description for this PR(en: English/zh: Chinese).
en: Fix the same staticcheck issues that were addressed in
protoc-gen-rpc-swaggerbut missed inprotoc-gen-http-swagger. This is a supplement to PR #18.*&dereferencezh(optional): 修复
protoc-gen-rpc-swagger中已处理但protoc-gen-http-swagger中遗漏的 staticcheck 问题,作为 PR #18 的补充。*&解引用(Optional) Which issue(s) this PR fixes:
Supplements #18
(optional) The PR that updates user documentation:
N/A