package main import ( "log" ) func main() { // pase the command line aguments registerFlags() // read the wordlist from a file wordlist, err := readWordlist(wordlist) if err != nil { log.Println(err) } // define a channel to store the wordlist in wordlistChannel := make(chan string) // define a channel in which the response gets written into from the go // routines printChannel := make(chan Response) // write the wordlist into a channel writeWordlistToChannel(wordlistChannel, wordlist) // print the responses from the printChannel go printResponses(printChannel) if threads > 1 { httpRequest(wordlistChannel, printChannel) } else { // loop over all the threads starting a go routine fetching a word from // the wordlistChannel, making the request and inserting the result into // the printChannel for i := 0; i < threads; i++ { go httpRequest(wordlistChannel, printChannel) } } }