【发布时间】:2019-04-23 07:42:47
【问题描述】:
我正在尝试将一组通道传递给方法“func Data(channel chan
func Data(channel chan<- []Book) {
var data EData
data = ReadJSONFile("Data.json")
go Writer(data.BookStores[0].Central, channel[0]) // at this
// place I get "invalid operation: channel[0] (type chan<- []Book
// does not support indexing)"
}
【问题讨论】:
标签: go