Skip to content

refactor: simplify channel reading with range#307

Merged
tenthirtyam merged 1 commit intomainfrom
refactor/simplify-channel-reading
May 21, 2025
Merged

refactor: simplify channel reading with range#307
tenthirtyam merged 1 commit intomainfrom
refactor/simplify-channel-reading

Conversation

@tenthirtyam
Copy link
Copy Markdown
Collaborator

reading would always be true. ut simplifying would leave it not used.

So, therefore refactored the loop using built-in range keyword for channels, which provides a more concise and readable way to iterate through channel values until the channel is closed.

~/Downloads/packer-plugin-vmware git:[refactor/simplify-channel-reading]
make test
?       github.com/hashicorp/packer-plugin-vmware       [no test files]
ok      github.com/hashicorp/packer-plugin-vmware/builder/vmware/common 6.901s
ok      github.com/hashicorp/packer-plugin-vmware/builder/vmware/iso    2.241s
ok      github.com/hashicorp/packer-plugin-vmware/builder/vmware/vmx    2.737s
?       github.com/hashicorp/packer-plugin-vmware/version       [no test files]

`reading` would always be true. ut simplifying would leave it not used.

So, therefor refactored the loop using built-in `range` keyword for channels, which provides a more concise and readable way to iterate through channel values until the channel is closed.

Signed-off-by: Ryan Johnson <ryan.johnson@broadcom.com>
@tenthirtyam tenthirtyam added this to the v1.2.0 milestone May 21, 2025
@tenthirtyam tenthirtyam requested a review from JenGoldstrich May 21, 2025 17:28
@tenthirtyam tenthirtyam self-assigned this May 21, 2025
@tenthirtyam tenthirtyam requested a review from a team as a code owner May 21, 2025 17:28
@tenthirtyam tenthirtyam merged commit 99cc807 into main May 21, 2025
14 checks passed
@tenthirtyam tenthirtyam deleted the refactor/simplify-channel-reading branch May 21, 2025 22:48
@github-actions
Copy link
Copy Markdown

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants