Skip to content
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

Use a type-switch #102

Merged
merged 1 commit into from
Sep 3, 2024
Merged

Use a type-switch #102

merged 1 commit into from
Sep 3, 2024

Conversation

webbnh
Copy link
Contributor

@webbnh webbnh commented Sep 3, 2024

Changes introduced with this PR

This is a small code quality change which I suggested in a previous review but I was late to the game, so I'm posting it myself: rather than a series of type assertions trying to figure out what type an object is, let's use a Go type-switch statement, which was made for just that. And, I made a couple of other tweaks to the function code.


By contributing to this repository, I agree to the contribution guidelines.

@webbnh webbnh self-assigned this Sep 3, 2024
@webbnh webbnh merged commit 28af219 into main Sep 3, 2024
3 checks passed
@webbnh webbnh deleted the lets-switch branch September 3, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants