go-nsq

    0熱度

    1回答

    在go-nsq庫(https://github.com/bitly/go-nsq/blob/master/writer_test.go#L38),我發現下面的代碼: log.SetOutput(ioutil.Discard) defer log.SetOutput(os.Stdout) 爲什麼作者延遲記錄到標準輸出後丟棄日誌?

    0熱度

    1回答

    試圖學習nsq,並遵循here golang example和here nsqjs的示例。我在服務器端發送消息做瓦特/一個for循環,去例程 var wg sync.WaitGroup for i := 0; i < 100; i++ { wg.Add(1) go func(x int) { defer wg.Done() chanName := f