Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Go 如何传递通道数组_Go - Fatal编程技术网

Go 如何传递通道数组

Go 如何传递通道数组,go,Go,我正在尝试将通道数组传递给方法“func Data”(channel chan传递书本元素通道片段的正确类型是: []chan<- Book []chanchan可能重复的 []chan<- Book func Data(channel []chan<- Book) { var data EData data = ReadJSONFile("Data.json") go Writer(data.BookStores[0].Central, chan

我正在尝试将通道数组传递给方法“func Data”(channel chan传递书本元素通道片段的正确类型是:

[]chan<- Book
[]chan
chan可能重复的
[]chan<- Book
func Data(channel []chan<- Book) {
    var data EData
    data = ReadJSONFile("Data.json")

    go Writer(data.BookStores[0].Central, channel[0])
    // ...
}