Skip to content

Commit

Permalink
Adding RandomBool() method to get a boolean value
Browse files Browse the repository at this point in the history
  • Loading branch information
erdvillegas committed May 20, 2020
1 parent 9ea1a29 commit 771e0bd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions faker.go
Expand Up @@ -104,6 +104,15 @@ func RandomChoice(ss []string) string {
return ss[localRand.Intn(len(ss))]
}

// RandomBool returns a true or false
func RandomBool() bool {
dato := RandomInt(0, 1)
if dato == 1 {
return true
}
return false
}

func includesString(ss []string, s string) bool {
for _, v := range ss {
if v == s {
Expand Down

0 comments on commit 771e0bd

Please sign in to comment.