jaswdr / faker

:rocket: Ultimate fake data generator for Go with zero dependencies
https://pkg.go.dev/github.com/jaswdr/faker
MIT License
566 stars 59 forks source link

fix: UUID V4 generation #138

Closed pankaj-kumar34 closed 1 year ago

pankaj-kumar34 commented 1 year ago

Description

Fix return value of UUID V4

Go Version

$ go version
go version go1.19.8 darwin/amd64

Go Tests

$ go test
2023/05/06 21:11:33 Error while requesting https://loremflickr.com/300/200 : request failed
2023/05/06 21:11:34 Error while creating a temp file: temp file creation failed
2023/05/06 21:11:35 Error while requesting https://randomuser.me : request failed
2023/05/06 21:11:35 Error while creating a temp file: temp file creation failed
PASS
ok      github.com/jaswdr/faker 12.356s
jaswdr commented 1 year ago

I'm a bit worry that this could break consumers that either are relying on the previous format or are already fixing the string. On the other hand, the intension of this method is to comply with UUID and generate an unique string that could be used in a variate of ways. This change is complying with this purpose and this change is also fixing the issue which the string is not valid when using any UUID validator. My conclusion is that we should move on and merge it 👍

jaswdr commented 1 year ago

Congrats on your first PR @pankaj-kumar34 🎉