Skip to content

Commit cadf753

Browse files
committed
fix: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: As of Go 1.20 there is no reason to call Seed with a random value. Programs that call Seed with a known value to get a specific sequence of results should use New(NewSource(seed)) to obtain a local random generator. (SA1019)
1 parent 205e6d2 commit cadf753

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

api/write/point_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ var points []*Point
2323

2424
func init() {
2525
points = make([]*Point, 5000)
26-
rand.Seed(321)
2726

2827
t := time.Now()
2928
for i := 0; i < len(points); i++ {

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/influxdata/influxdb-client-go/v2
22

3-
go 1.17
3+
go 1.23.0
4+
5+
toolchain go1.23.8
46

57
require (
68
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839

internal/test/generators.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
// GenPoints generates num points
1212
func GenPoints(num int) []*write.Point {
1313
points := make([]*write.Point, num)
14-
rand.Seed(321)
1514

1615
t := time.Now()
1716
for i := 0; i < len(points); i++ {
@@ -40,7 +39,6 @@ func GenPoints(num int) []*write.Point {
4039
// GenRecords generates num points
4140
func GenRecords(num int) []string {
4241
lines := make([]string, num)
43-
rand.Seed(321)
4442

4543
t := time.Now()
4644
for i := 0; i < len(lines); i++ {

0 commit comments

Comments
 (0)