snippets: add forrval snippet for single-variable range loops#4027
snippets: add forrval snippet for single-variable range loops#4027vinaycharlie01 wants to merge 2 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Add a new snippet 'forrch' that generates a for-range loop with a single variable, commonly used with channels.
23b46c9 to
d1c281d
Compare
|
This PR (HEAD: d1c281d) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/vscode-go/+/770800. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Madeline Kalil: Patch Set 2: Commit-Queue+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Go LUCI: Patch Set 2: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2026-04-27T17:01:39Z","revision":"53fde310687f4a0712ef76933f2a6dfda95b002f"} Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Madeline Kalil: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Madeline Kalil: Patch Set 2: -Commit-Queue (Performed by <GERRIT_ACCOUNT_60063> on behalf of <GERRIT_ACCOUNT_3771561>) Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Go LUCI: Patch Set 2: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Go LUCI: Patch Set 2: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
This PR (HEAD: fa67748) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/vscode-go/+/770800. Important tips:
|
|
Message from Vinay kumar: Patch Set 3: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Madeline Kalil: Patch Set 5: Code-Review+2 Commit-Queue+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Go LUCI: Patch Set 5: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2026-05-01T15:20:46Z","revision":"c57b739918b97bda7910730f2de90042d8a13c28"} Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Madeline Kalil: Patch Set 5: -Commit-Queue (Performed by <GERRIT_ACCOUNT_60063> on behalf of <GERRIT_ACCOUNT_3771561>) Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Go LUCI: Patch Set 5: This CL has failed the run. Reason: Tryjob golang/try/x_vscode-go-go1.26-linux-amd64_docker has failed with summary (view all results):
To reproduce, try Additional links for debugging: Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Go LUCI: Patch Set 5: LUCI-TryBot-Result-1 Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Madeline Kalil: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Hongxiang Jiang: Patch Set 6: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 6: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2026-05-08T20:26:51Z","revision":"c24f882508e78522ce6899ac7c93f5a0a7724359"} Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Hongxiang Jiang: Patch Set 6: -Commit-Queue (Performed by <GERRIT_ACCOUNT_60063> on behalf of <GERRIT_ACCOUNT_3494492>) Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 6: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 6: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
|
Message from Cherry Mui: Patch Set 6: Code-Review+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/770800. |
Add a new snippet, forrval, that generates a for-range loop with a single variable, commonly used with channels and, in Go 1.23+, for value-only iteration over slices and maps.
The snippet expands to:
for v := range v {
}
Updates #4026