From 0e4b23e79b8fe4f77771b996799b40b5d118d04e Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 26 Aug 2018 19:25:41 +0200 Subject: strip rand --- cmd/theo/main.go | 11 ----------- go.mod | 1 + theo.go | 17 +++-------------- 3 files changed, 4 insertions(+), 25 deletions(-) delete mode 100644 cmd/theo/main.go create mode 100644 go.mod diff --git a/cmd/theo/main.go b/cmd/theo/main.go deleted file mode 100644 index 12ec5e4..0000000 --- a/cmd/theo/main.go +++ /dev/null @@ -1,11 +0,0 @@ -package main - -import ( - "fmt" - - "dim13.org/theo" -) - -func main() { - fmt.Println(theo.Random()) -} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..98995a2 --- /dev/null +++ b/go.mod @@ -0,0 +1 @@ +module dim13.org/theo diff --git a/theo.go b/theo.go index 09325da..6911dc8 100644 --- a/theo.go +++ b/theo.go @@ -1,15 +1,10 @@ // $OpenBSD: theo.c,v 1.143 2014/11/19 21:22:47 schwarze Exp $ // Copyright (c) 2002 Artur Grabowski -// Package theo implements random quotes from Theo De Raadt -package theo - +// Package theo holds random quotes from Theo De Raadt +// // source: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/mg/theo.c - -import ( - "math/rand" - "time" -) +package theo // Quotes from Theo var Quotes = []string{ @@ -127,9 +122,3 @@ var Quotes = []string{ `Well finally everyone can see that the shit is really shitty.`, `All that complexity stopped us from getting flying cars by today.`, } - -// Random quote -func Random() string { - rand.Seed(time.Now().UnixNano()) - return Quotes[rand.Intn(len(Quotes))] -} -- cgit v1.2.3