I'm trying to set up a Toplist app to get hot topics on the Internet. The Github project is here. This project is built by Golang and Mysql.
The program tries to grab hot information from several pages at the same time. error shows dial tcp: lookup tcp/port: getaddrinfow: The specified class was not found.
when I run the client app.
Note that I'm a newbie to golang and mysql, Please forgive me if I didn't describe this problem well. :)
I am on windows os. I open an issue about this error on the Github but have not been answered yet. The getaddrinfow
seems to be a windows socket related function where I found in this site
I debugged the code in Goland. I got error in this line:
error occurred in group.Wait()
allData := []string{
"V2EX",
"ZhiHu",
"WeiBo",
}
fmt.Println("starting catching" + strconv.Itoa(len(allData)) + "types of data")
group.Add(len(allData))
var spider Spider
for _, value := range allData {
fmt.Println("starting catching" + value)
spider = Spider{DataType: value}
go ExecGetData(spider)
}
group.Wait() //error occured in group.Wait()
fmt.Print("completed catching")
}
Here is where the error had been thrown (in line 5).
if atomic.CompareAndSwapUint64(statep, state, state+1) {
if race.Enabled && w == 0 {
race.Write(unsafe.Pointer(semap))
}
runtime_Semacquire(semap) // where error occured
if *statep != 0 {
panic("sync: WaitGroup is reused before previous Wait has returned")