Rename Random() to Hack()

This commit is contained in:
Zorchenhimer 2021-02-14 16:49:11 -05:00
parent abec5d2651
commit ef8f4176b1
Signed by: Zorchenhimer
GPG Key ID: 70A1AB767AAB9C20
4 changed files with 6 additions and 6 deletions

View File

@ -35,7 +35,7 @@ func main() {
}
if count == 1 {
sentence, err := hq.Random()
sentence, err := hq.Hack()
if err != nil {
fmt.Println(err)
os.Exit(1)
@ -45,7 +45,7 @@ func main() {
} else {
fmt.Println("")
for i := 0; i < count; i++ {
sentence, err := hq.Random()
sentence, err := hq.Hack()
if err != nil {
fmt.Println(err)
os.Exit(1)

View File

@ -5,7 +5,7 @@ import (
)
func (f *Frontend) home(w http.ResponseWriter, r *http.Request) {
words, err := f.hq.Random()
words, err := f.hq.Hack()
if err != nil {
w.Write([]byte(err.Error()))
return

View File

@ -19,7 +19,7 @@ func NewGeneric(db database.DB) (HackerQuotes, error) {
return &generic{db: db}, nil
}
func (g *generic) Random() (string, error) {
func (g *generic) Hack() (string, error) {
definite := rand.Int() % 2 == 0
hasAdj := rand.Int() % 2 == 0
plural := rand.Int() % 2 == 0

View File

@ -6,8 +6,8 @@ import (
)
type HackerQuotes interface {
// Random returns a completely randomized quote.
Random() (string, error)
// Hack returns a completely randomized quote.
Hack() (string, error)
// Format returns a quote in the given format.
Format(format string) (string, error)