Go语言向动态加载函数传递通道参数问题求助
Go插件动态加载函数传递chan参数遇到问题求助
我是Go语言和Go插件的新手,最近在给动态加载的函数传递chan对象时碰了壁——传int类型参数的时候一切正常,但换成chan就不行了,完全搞不懂哪里出问题了,麻烦各位大佬帮忙看看!
相关代码:
dataunit.go
package main type DataUnit struct { i int s string }
modcounter.go
package main import ( "fmt" // "strconv" ) type module string //func (m module) RunMod(i int) { func (m module) RunMod(in <-chan *DataUnit) { //fmt.Println("Hello Universe " + strconv.Itoa(i)) fmt.Println("Hello Universe ") n := <-... }
内容的提问来源于stack exchange,提问作者martin
相关产品推荐
相关产品推荐

