about summary refs log tree commit diff
path: root/src/wordlist.go
diff options
context:
space:
mode:
authorEmile <hanemile@protonmail.com>2019-11-01 18:56:19 +0100
committerEmile <hanemile@protonmail.com>2019-11-01 18:56:19 +0100
commita6ccee210537232664b3cf98e7600909d7076e8d (patch)
tree87e93a271d7ddea27ab1bdfbe18703c86ca69936 /src/wordlist.go
parentc10cd1f770fab876acf3fa9fd7bda9b85d81d4a4 (diff)
simple working basic setup
Diffstat (limited to 'src/wordlist.go')
-rw-r--r--src/wordlist.go26
1 files changed, 26 insertions, 0 deletions
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
+}