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

maint: create generic set and use it #976

Merged
merged 4 commits into from
Jan 25, 2024
Merged

maint: create generic set and use it #976

merged 4 commits into from
Jan 25, 2024

Conversation

kentquirk
Copy link
Contributor

@kentquirk kentquirk commented Jan 24, 2024

Which problem is this PR solving?

  • Now that Go supports some forms of generics, we can create and use a generic set rather than monkeying around with map[T]struct{}. It's clearer and just as fast.

Short description of the changes

  • This adds a new type in a "generics" package. The code is mostly copied from similar code we have internally in another repository at Honeycomb.
  • Same tests as in the original.
  • Uses it in all but one of the places it could be used (I didn't touch the last one in sampler_config.go because it will affect work going on in a different branch; we can cherry pick this over and then fix it there.)
  • Also includes de-flaking an unrelated test

@kentquirk kentquirk requested a review from a team as a code owner January 24, 2024 22:53
@kentquirk kentquirk requested a review from VinozzZ January 24, 2024 22:56
@kentquirk kentquirk merged commit cf0e805 into main Jan 25, 2024
4 checks passed
@kentquirk kentquirk deleted the kent.generic_set branch January 25, 2024 15:22
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