-
Notifications
You must be signed in to change notification settings - Fork 2.3k
gopls/internal/golang: add support for variadic functions and constructors in generated tests #609
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
base: master
Are you sure you want to change the base?
Conversation
… generated tests Add `IsVariadic` flag to function metadata and expand variadic arguments with `...` in test templates. Update constructor handling to propagate variadic information. Refactor import collection helper and add varargs test cases. Fixes #76682
|
This PR (HEAD: 1ba3d7b) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/727280. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/727280. |
|
Message from Hongxiang Jiang: Patch Set 1: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/727280. |
|
Message from Go LUCI: Patch Set 1: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2025-12-06T00:30:06Z","revision":"bfabb7b86c59f8f2b6f0a4191dc6910eb3c22861"} Please don’t reply on this GitHub thread. Visit golang.org/cl/727280. |
|
Message from Hongxiang Jiang: Patch Set 1: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/727280. |
|
Message from Go LUCI: Patch Set 1: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/727280. |
|
Message from Go LUCI: Patch Set 1: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/727280. |
|
Message from Hongxiang Jiang: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/727280. |
…ndling in test generation Introduce `isUnusedParameter` helper to replace repeated `name == "" || name == "_"` checks. Refactor logic for both functions and constructors to use the helper and correctly skip unused variadic arguments while generating test case structs.
|
This PR (HEAD: acb706d) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/727280. Important tips:
|
|
Message from Ilya Ilyinykh: Patch Set 2: (4 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/727280. |
Add IsVariadic flag to function metadata and expand variadic arguments with ...
in test templates.
Update constructor handling to propagate variadic information.
Fixes golang/go#76682