MCPcopy
hub / github.com/brianvoe/gofakeit / IntN

Method IntN

number.go:144–144  ·  view source on GitHub ↗

IntN will generate a random int value between 0 and n

(n int)

Source from the content-addressed store, hash-verified

142
143// IntN will generate a random int value between 0 and n
144func (f *Faker) IntN(n int) int { return intNFunc(f, n) }
145
146func intNFunc(f *Faker, n int) int {
147 if n <= 0 {

Callers 15

getRandValueFunction · 0.80
replaceWithNumbersFunction · 0.80
randLetterFunction · 0.80
randHexLetterFunction · 0.80
randDigitFunction · 0.80
randIntRangeFunction · 0.80
ipv4AddressFunction · 0.80
ipv6AddressFunction · 0.80
macAddressFunction · 0.80
currencyFunction · 0.80
shuffleIntsFunction · 0.80
randomIntFunction · 0.80

Calls 1

intNFuncFunction · 0.85

Tested by 5

TestLookupCheckingFunction · 0.64
TestLookupCallsFunction · 0.64
TestExternalCustomTypeFunction · 0.64
TestGetAllRequestsFunction · 0.64
TestPostAllRequestsFunction · 0.64