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

Migrate to math/rand/v2 #10885

Closed
2 tasks done
mx-psi opened this issue Aug 14, 2024 · 1 comment · Fixed by #10889
Closed
2 tasks done

Migrate to math/rand/v2 #10885

mx-psi opened this issue Aug 14, 2024 · 1 comment · Fixed by #10889
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Good issue for contributors to OpenTelemetry Service to pick up priority:p3 Lowest

Comments

@mx-psi
Copy link
Member

mx-psi commented Aug 14, 2024

Go 1.22 introduced math/rand/v2 which replaces the math/rand stdlib package. We should migrate to it!

Once we have migrated, we can forbid its usage via depguard.

Components using math/rand v1:

  • exporter/exportertest
  • receiver/receivertest

(generated using rg math/rand -l -tgo | cut -d'/' -f1-2 | sort | uniq | sed 's/^/- [ ] /')

Counterpart to open-telemetry/opentelemetry-collector-contrib/issues/34676.

@mx-psi mx-psi added enhancement New feature or request priority:p3 Lowest help wanted Good issue for contributors to OpenTelemetry Service to pick up good first issue Good for newcomers labels Aug 14, 2024
@webstradev
Copy link
Contributor

I can pick this up

mx-psi pushed a commit that referenced this issue Aug 14, 2024
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Migrated rand dependency to rand/v2. We only use rand in tests and mocks
and the only two functions we use are float32 and float64 which still
exist in the new v2 API so nothing very exciting going on here.

<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes #10885

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Ran `make test` successfully

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Signed-off-by: Erik Westra <e.s.westra.95@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Good issue for contributors to OpenTelemetry Service to pick up priority:p3 Lowest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants