Skip to content

refactor: use switch cdromAdapterType#294

Merged
tenthirtyam merged 1 commit intomainfrom
refactor/use-switch-for-cdrom-adapter
Apr 28, 2025
Merged

refactor: use switch cdromAdapterType#294
tenthirtyam merged 1 commit intomainfrom
refactor/use-switch-for-cdrom-adapter

Conversation

@tenthirtyam
Copy link
Copy Markdown
Collaborator

@tenthirtyam tenthirtyam commented Apr 28, 2025

Replace the if-else if-else block used to determine the value of diskData.CDROMType_PrimarySecondary based on cdromAdapterType with an equivalent switch statement.

The switch statement improves readability and is the more idiomatic Go construct when evaluating a single variable against multiple distinct conditions (empty string, matching diskAdapterType, or default).

This change preserves the original logic and behavior.

Replace the if-else if-else block used to determine the value of `diskData.CDROMType_PrimarySecondary` based on `cdromAdapterType` with an equivalent switch statement.

The switch statement improves readability and is the more idiomatic Go construct when evaluating a single variable against multiple distinct conditions (empty string, matching diskAdapterType, or default).

This change preserves the original logic and behavior.

Signed-off-by: Ryan Johnson <ryan.johnson@broadcom.com>
@tenthirtyam tenthirtyam added this to the v1.1.1 milestone Apr 28, 2025
@tenthirtyam tenthirtyam self-assigned this Apr 28, 2025
@tenthirtyam tenthirtyam requested a review from a team as a code owner April 28, 2025 00:31
@tenthirtyam tenthirtyam merged commit 71dd813 into main Apr 28, 2025
14 checks passed
@tenthirtyam tenthirtyam deleted the refactor/use-switch-for-cdrom-adapter branch April 28, 2025 16:18
@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