Skip to content

Commit

Permalink
chore (deps): migrate rand to rand/v2 (#10889)
Browse files Browse the repository at this point in the history
<!--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 <[email protected]>
  • Loading branch information
webstradev authored Aug 14, 2024
1 parent d5d1f82 commit 38c8f41
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ linters-settings:
desc: "Use 'errors' or 'fmt' instead of github.com/pkg/errors"
- pkg: github.com/hashicorp/go-multierror
desc: "Use go.uber.org/multierr instead of github.com/hashicorp/go-multierror"
- pkg: "math/rand$"
desc: "Use the newer 'math/rand/v2' instead of math/rand"
# Add a different guard rule so that we can ignore tests.
ignore-in-test:
deny:
Expand Down
2 changes: 1 addition & 1 deletion exporter/exportertest/mock_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package exportertest // import "go.opentelemetry.io/collector/exporter/exportert
import (
"context"
"fmt"
"math/rand"
"math/rand/v2"
"sync"

"google.golang.org/grpc/codes"
Expand Down
2 changes: 1 addition & 1 deletion receiver/receivertest/contract_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"context"
"errors"
"fmt"
"math/rand"
"math/rand/v2"
"sync"
"sync/atomic"
"testing"
Expand Down

0 comments on commit 38c8f41

Please sign in to comment.