Skip to content

Commit

Permalink
Use newer math/rand/v2
Browse files Browse the repository at this point in the history
  • Loading branch information
dhui committed Sep 7, 2024
1 parent f44379d commit 1b1c6f6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions testing/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ import (
dockerclient "github.com/docker/docker/client"
"github.com/hashicorp/go-multierror"
"io"
"math/rand"
"math/rand/v2"

Check failure on line 18 in testing/docker.go

View workflow job for this annotation

GitHub Actions / test (1.21.x)

package math/rand/v2 is not in std (/opt/hostedtoolcache/go/1.21.13/x64/src/math/rand/v2)
"strconv"
"strings"
"testing"
"time"
)

func NewDockerContainer(t testing.TB, image string, env []string, cmd []string) (*DockerContainer, error) {
Expand Down Expand Up @@ -286,15 +285,11 @@ type dockerImagePullOutput struct {
Progress string `json:"progress"`
}

func init() {
rand.Seed(time.Now().UnixNano())
}

func pseudoRandStr(n int) string {
var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz0123456789")
b := make([]rune, n)
for i := range b {
b[i] = letterRunes[rand.Intn(len(letterRunes))]
b[i] = letterRunes[rand.IntN(len(letterRunes))]
}
return string(b)
}

0 comments on commit 1b1c6f6

Please sign in to comment.