Skip to content

Commit c64740c

Browse files
committed
feat: use fast srand
1 parent cc53395 commit c64740c

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

go.mod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@ module moul.io/guilhunize
22

33
go 1.13
44

5-
require gopkg.in/urfave/cli.v2 v2.0.0-20190806201727-b62605953717
5+
require (
6+
gopkg.in/urfave/cli.v2 v2.0.0-20190806201727-b62605953717
7+
moul.io/srand v1.4.0
8+
)

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
gopkg.in/urfave/cli.v2 v2.0.0-20190806201727-b62605953717 h1:OvXt/p4cdwNl+mwcWMq/AxaKFkhdxcjx+tx+qf4EOvY=
22
gopkg.in/urfave/cli.v2 v2.0.0-20190806201727-b62605953717/go.mod h1:cKXr3E0k4aosgycml1b5z33BVV6hai1Kh7uDgFOkbcs=
3+
moul.io/srand v1.4.0 h1:r5ZMiWDN0ni0lTV7KzJR/jx0K7GivJYW5WaXmufgeik=
4+
moul.io/srand v1.4.0/go.mod h1:P2uaZB+GFstFNo8sEj6/U8FRV1n25kD0LLckFpJ+qvc=

lambda/go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ gopkg.in/urfave/cli.v2 v2.0.0-20190806201727-b62605953717 h1:OvXt/p4cdwNl+mwcWMq
1818
gopkg.in/urfave/cli.v2 v2.0.0-20190806201727-b62605953717/go.mod h1:cKXr3E0k4aosgycml1b5z33BVV6hai1Kh7uDgFOkbcs=
1919
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
2020
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
21+
moul.io/srand v1.4.0/go.mod h1:P2uaZB+GFstFNo8sEj6/U8FRV1n25kD0LLckFpJ+qvc=

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import (
77
"math/rand"
88
"os"
99
"strings"
10-
"time"
1110

1211
cli "gopkg.in/urfave/cli.v2"
1312
"moul.io/guilhunize/guilhunize"
13+
"moul.io/srand"
1414
)
1515

1616
func main() {
@@ -28,7 +28,7 @@ func main() {
2828

2929
func run(c *cli.Context) error {
3030
if c.Bool("quote") {
31-
rand.Seed(time.Now().UnixNano())
31+
rand.Seed(srand.Fast())
3232
fmt.Println(guilhunize.Quote())
3333
return nil
3434
}

0 commit comments

Comments
 (0)