You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
280 B

package WorstCaptcha
import (
"io/ioutil"
"os"
"math/rand"
"strings"
)
func GetRandomWord() string {
dir, _ := os.Getwd()
files, _ := ioutil.ReadDir(dir + "/images/")
files = files[1:]
file := files[rand.Intn(len(files))].Name()
return strings.Split(file, ".")[0]
}