https record test for domains added

This commit is contained in:
MDK
2024-03-26 10:35:39 +08:00
parent 1b819f659f
commit 6c585e67a2
7 changed files with 1001115 additions and 7 deletions

View File

@@ -29,3 +29,21 @@ func RetrieveLines(pool chan string, filename string) {
}
close(pool)
}
func RetrieveLinesToSlice(filename string) []string {
results := []string{}
f, err := os.Open(filename)
if err != nil {
panic(err)
}
reader := bufio.NewReader(f)
for {
s, err := reader.ReadString('\n')
if err == io.EOF {
break
}
s = strings.Trim(s, "\n")
results = append(results, s)
}
return results
}