From a6ccee210537232664b3cf98e7600909d7076e8d Mon Sep 17 00:00:00 2001 From: Emile Date: Fri, 1 Nov 2019 18:56:19 +0100 Subject: simple working basic setup --- src/wordlist.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/wordlist.go (limited to 'src/wordlist.go') diff --git a/src/wordlist.go b/src/wordlist.go new file mode 100644 index 0000000..76df5f4 --- /dev/null +++ b/src/wordlist.go @@ -0,0 +1,26 @@ +package main + +import ( + "bufio" + "os" +) + +func readWordlist(wordlistPath string) ([]string, error) { + file, err := os.Open(wordlistPath) + if err != nil { + return nil, err + } + defer file.Close() + + scanner := bufio.NewScanner(file) + scanner.Split(bufio.ScanLines) + + var lines []string + + for scanner.Scan() { + lines = append(lines, scanner.Text()) + } + + // return the lines, the line count and no error + return lines, nil +} -- cgit 1.4.1