Skip to content

Commit 2db8b8a

Browse files
author
wintrmvte
committed
+ RandomBool()
1 parent 26990b5 commit 2db8b8a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

random.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,8 @@ func RandomString(n int) string {
3535

3636
return string(b)
3737
}
38+
39+
func RandomBool() bool {
40+
rand.Seed(time.Now().UnixNano())
41+
return rand.Intn(2) == 1
42+
}

0 commit comments

Comments
 (0)