jaswdr / faker

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

Fix StatusCodeWithMessage to not use index out of range #57

Closed jaswdr closed 3 years ago

jaswdr commented 3 years ago

Description

Fixing a bug where the StatusCodeWithMessage() method was using a value out of the range of the string list, causing some tests randomly failing when this happens, example of occurence.

Are you trying to fix an existing issue?

StatusCodeWithMessage raising an out of range exception

Go Version

$ go version
go version devel go1.17-053fe2f Sat May 1 19:17:47 2021 +0000 linux/amd64

Go Tests

$ go test
PASS
ok      github.com/jaswdr/faker 0.718s