parent
c4505e0894
commit
0fa3a2c06c
@ -0,0 +1,19 @@
|
||||
package WorstCaptcha
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"math/rand"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func GetRandomWord() string {
|
||||
dir, _ := os.Getwd()
|
||||
|
||||
files, _ := ioutil.ReadDir(dir + "/images/")
|
||||
|
||||
file := files[rand.Intn(len(files))].Name()
|
||||
|
||||
return strings.Split(file, ".")[0]
|
||||
}
|
Loading…
Reference in new issue