You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -33,13 +33,13 @@ Thank you to all our Gofakeit contributors!
33
33
## Installation
34
34
35
35
```go
36
-
go get github.com/brianvoe/gofakeit/v6
36
+
go get github.com/brianvoe/gofakeit/v7
37
37
```
38
38
39
39
## Simple Usage
40
40
41
41
```go
42
-
import"github.com/brianvoe/gofakeit/v6"
42
+
import"github.com/brianvoe/gofakeit/v7"
43
43
44
44
gofakeit.Name() // Markus Moen
45
45
gofakeit.Email() // alaynawuckert@kozey.biz
@@ -65,7 +65,7 @@ If you need a reproducible outcome you can set it via the Seed function call. Ev
65
65
this repo sets it for testing purposes.
66
66
67
67
```go
68
-
import"github.com/brianvoe/gofakeit/v6"
68
+
import"github.com/brianvoe/gofakeit/v7"
69
69
70
70
gofakeit.Seed(0) // If 0 will use crypto/rand to generate a number
71
71
@@ -76,25 +76,43 @@ gofakeit.Seed(8675309) // Set it to whatever number you want
76
76
77
77
## Random Sources
78
78
79
-
Gofakeit has a few rand sources, by default it uses math.Rand and uses mutex locking to allow for safe goroutines.
79
+
Gofakeit has a few rand sources, by default it uses math/rand/v2 PCG which is a pseudo random number generator and is thread locked.
80
80
81
-
If you want to use a more performant source please use NewUnlocked. Be aware that it is not goroutine safe.
81
+
If you want to see other potential sources you can see the sub package [Source](https://pkg.go.dev/github.com/brianvoe/gofakeit/v7/source) for more information.
82
82
83
83
```go
84
-
import"github.com/brianvoe/gofakeit/v6"
84
+
import (
85
+
"github.com/brianvoe/gofakeit/v7"
86
+
"github.com/brianvoe/gofakeit/v7/source"
87
+
"math/rand/v2"
88
+
)
85
89
86
-
// Uses math/rand(Pseudo) with mutex locking
90
+
// Uses math/rand/v2(PCG Pseudo) with mutex locking
87
91
faker:= gofakeit.New(0)
88
92
89
-
// Uses math/rand(Pseudo) with NO mutext locking
90
-
// More performant but not goroutine safe.
91
-
faker:= gofakeit.NewUnlocked(0)
93
+
// NewFaker takes in a source and whether or not it should be thread safe
0 commit comments