Skip to content

Commit

Permalink
feat: use fast srand
Browse files Browse the repository at this point in the history
moul committed Feb 25, 2020
1 parent cc53395 commit c64740c
Showing 4 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -2,4 +2,7 @@ module moul.io/guilhunize

go 1.13

require gopkg.in/urfave/cli.v2 v2.0.0-20190806201727-b62605953717
require (
gopkg.in/urfave/cli.v2 v2.0.0-20190806201727-b62605953717
moul.io/srand v1.4.0
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
gopkg.in/urfave/cli.v2 v2.0.0-20190806201727-b62605953717 h1:OvXt/p4cdwNl+mwcWMq/AxaKFkhdxcjx+tx+qf4EOvY=
gopkg.in/urfave/cli.v2 v2.0.0-20190806201727-b62605953717/go.mod h1:cKXr3E0k4aosgycml1b5z33BVV6hai1Kh7uDgFOkbcs=
moul.io/srand v1.4.0 h1:r5ZMiWDN0ni0lTV7KzJR/jx0K7GivJYW5WaXmufgeik=
moul.io/srand v1.4.0/go.mod h1:P2uaZB+GFstFNo8sEj6/U8FRV1n25kD0LLckFpJ+qvc=
1 change: 1 addition & 0 deletions lambda/go.sum
Original file line number Diff line number Diff line change
@@ -18,3 +18,4 @@ gopkg.in/urfave/cli.v2 v2.0.0-20190806201727-b62605953717 h1:OvXt/p4cdwNl+mwcWMq
gopkg.in/urfave/cli.v2 v2.0.0-20190806201727-b62605953717/go.mod h1:cKXr3E0k4aosgycml1b5z33BVV6hai1Kh7uDgFOkbcs=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
moul.io/srand v1.4.0/go.mod h1:P2uaZB+GFstFNo8sEj6/U8FRV1n25kD0LLckFpJ+qvc=
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -7,10 +7,10 @@ import (
"math/rand"
"os"
"strings"
"time"

cli "gopkg.in/urfave/cli.v2"
"moul.io/guilhunize/guilhunize"
"moul.io/srand"
)

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

func run(c *cli.Context) error {
if c.Bool("quote") {
rand.Seed(time.Now().UnixNano())
rand.Seed(srand.Fast())
fmt.Println(guilhunize.Quote())
return nil
}

0 comments on commit c64740c

Please sign in to comment.