Skip to content

chore: improve map cast functions #269

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

Merged
merged 1 commit into from
Jun 1, 2025
Merged

chore: improve map cast functions #269

merged 1 commit into from
Jun 1, 2025

Conversation

sagikazarmark
Copy link
Collaborator

No description provided.

Signed-off-by: Mark Sagi-Kazar <[email protected]>
@sagikazarmark sagikazarmark merged commit 633e5d0 into master Jun 1, 2025
18 checks passed
@andig
Copy link

andig commented Jul 9, 2025

@sagikazarmark the downside with this change is that any function ignoring the the error (i.e. without E suffix) will now receive a nil instead of an empty map. That's unexpected compared to older versions and doesn't quite fit the slogan of

safe and easy casting from one type to another in Go

I couldn't determine from the code if you strictly require this change for anything? If not I would propose to always return the empty map instead of nil, as before, as a sane and safe default.

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.

2 participants