faker icon indicating copy to clipboard operation
faker copied to clipboard

Add new constructor to faker

Open Kingmidas74 opened this issue 3 years ago • 1 comments

Description

I've added new constructor with pure number as parameter. It can simplify client code. We can reduce imports and pass rand.Source into the package

Go Version

$ go version
go version go1.19.5 darwin/arm64

Go Tests

$ go test
2023/02/27 22:30:26 Error while requesting https://loremflickr.com/300/200 : request failed
2023/02/27 22:30:26 Error while creating a temp file: temp file creation failed
2023/02/27 22:30:27 Error while requesting https://thispersondoesnotexist.com/image : request failed
2023/02/27 22:30:27 Error while creating a temp file: temp file creation failed
PASS
ok      github.com/jaswdr/faker 5.388s

Kingmidas74 avatar Feb 27 '23 19:02 Kingmidas74

Thank you for the contribution. There is one failed check from DeepSource related with the weak random number and the math/rand package. Would you mind replacing the math/rand with crypto/rand so we can get rid of this warning?

jaswdr avatar Feb 28 '23 09:02 jaswdr