→ lycantrope: Done似乎要回傳一個chan內含nil 133.51.216.27 02/08 15:15
→ rwweeeh: 試過了 在DoAndReturn回傳 還是不work118.163.149.125 02/08 15:18
→ lycantrope: 回傳chan error放nil一樣錯誤喔? 133.51.216.27 02/08 15:29
→ terter: 你直接return make(chan err), 然後丟nil 27.105.100.6 02/08 15:39
→ terter: 進去吧。直接給nil,你等半天也不會結束 27.105.100.6 02/08 15:40
→ terter: 補充,總之不能直接return nil, 它會卡 27.105.100.6 02/08 15:44
→ terter: 你要產一個make(chan error), 然後那個 27.105.100.6 02/08 15:45
→ terter: func() chan error那邊return那個chan 27.105.100.6 02/08 15:45
→ terter: 最後用go func丟個nil進去那個chan吧 27.105.100.6 02/08 15:45
→ rwweeeh: 大大 嘗試過你們的方式118.163.149.125 02/08 16:08
→ rwweeeh: 改法補充在stackoverflow最後面 不work118.163.149.125 02/08 16:09
→ terter: 你不能把ch<-nil放在那,會卡在那邊,請用go 122.116.86.61 02/08 21:47
→ terter: func(){ch <- nil } 來丟 122.116.86.61 02/08 21:47
→ terter: 或是你make chan要加大buffer不然會堵塞 122.116.86.61 02/08 21:51
→ lycantrope: CreateVService有mock嗎 138.199.39.153 02/08 23:08
→ rwweeeh: 謝各位熱心回答,正確寫法補充在文章內118.163.149.125 02/09 16:45