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 maps.Clone() where appropriate #1391

Closed
wants to merge 1 commit into from
Closed

Conversation

montag451
Copy link
Contributor

Go 1.21 introduced a new maps package which provides some utility functions to facilitate some common operations on map. One of these functions is maps.Clone which eases the cloning of a map. Moreover, the maps.Clone function is slightly more efficient than manual cloning (cf golang/go@b5a7f2e)

@montag451
Copy link
Contributor Author

I missed the fact that maps.Clone return a nil map when the passed map is nil which lead to crashes in some parts of the code so I prefer to close the PR because the benefit of using maps.Clone is not as high as expected.

@montag451 montag451 closed this Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant