drju37335 2019-09-03 02:41
浏览 73

与功能Wait()有关的问题

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")
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?
    • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line