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

fix: replace rand.seed method to support golang 1.20 #1343

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/sqlboiler-sqlite3/driver/sqlite3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (
)

func TestDriver(t *testing.T) {
rand.Seed(time.Now().Unix())
rand.New(rand.NewSource(time.Now().Unix()))
b, err := os.ReadFile("testdatabase.sql")
if err != nil {
t.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion templates/test/singleton/boil_main_test.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestMain(m *testing.M) {
os.Exit(-1)
}

rand.Seed(time.Now().UnixNano())
rand.New(rand.NewSource(time.Now().UnixNano()))

flag.Parse()

Expand Down
14 changes: 7 additions & 7 deletions types/array_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func TestBoolArrayValue(t *testing.T) {
}

func BenchmarkBoolArrayValue(b *testing.B) {
rand.Seed(1)
rand.New(rand.NewSource(1))
x := make([]bool, 10)
for i := 0; i < len(x); i++ {
x[i] = rand.Intn(2) == 0
Expand Down Expand Up @@ -477,7 +477,7 @@ func TestBytesArrayValue(t *testing.T) {
}

func BenchmarkBytesArrayValue(b *testing.B) {
rand.Seed(1)
rand.New(rand.NewSource(1))
x := make([][]byte, 10)
for i := 0; i < len(x); i++ {
x[i] = make([]byte, len(x))
Expand Down Expand Up @@ -634,7 +634,7 @@ func TestFloat64ArrayValue(t *testing.T) {
}

func BenchmarkFloat64ArrayValue(b *testing.B) {
rand.Seed(1)
rand.New(rand.NewSource(1))
x := make([]float64, 10)
for i := 0; i < len(x); i++ {
x[i] = rand.NormFloat64()
Expand Down Expand Up @@ -787,7 +787,7 @@ func TestInt64ArrayValue(t *testing.T) {
}

func BenchmarkInt64ArrayValue(b *testing.B) {
rand.Seed(1)
rand.New(rand.NewSource(1))
x := make([]int64, 10)
for i := 0; i < len(x); i++ {
x[i] = rand.Int63()
Expand Down Expand Up @@ -1229,7 +1229,7 @@ func TestGenericArrayValueErrors(t *testing.T) {
}

func BenchmarkGenericArrayValueBools(b *testing.B) {
rand.Seed(1)
rand.New(rand.NewSource(1))
x := make([]bool, 10)
for i := 0; i < len(x); i++ {
x[i] = rand.Intn(2) == 0
Expand All @@ -1242,7 +1242,7 @@ func BenchmarkGenericArrayValueBools(b *testing.B) {
}

func BenchmarkGenericArrayValueFloat64s(b *testing.B) {
rand.Seed(1)
rand.New(rand.NewSource(1))
x := make([]float64, 10)
for i := 0; i < len(x); i++ {
x[i] = rand.NormFloat64()
Expand All @@ -1255,7 +1255,7 @@ func BenchmarkGenericArrayValueFloat64s(b *testing.B) {
}

func BenchmarkGenericArrayValueInt64s(b *testing.B) {
rand.Seed(1)
rand.New(rand.NewSource(1))
x := make([]int64, 10)
for i := 0; i < len(x); i++ {
x[i] = rand.Int63()
Expand Down
Loading