Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.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
具有值数组的Golang映射_Go - Fatal编程技术网

具有值数组的Golang映射

具有值数组的Golang映射,go,Go,这句话在围棋中是什么意思: Student.bookMap=map[string][]*model.Books{} 其中Student是: type Student struct{ bookMap map[string][]*model.Books } 我们有一个模型包 package model type Books struct { bookName string `db:"Name"` bookAuthor string `db:"Author"` }

这句话在围棋中是什么意思:

Student.bookMap=map[string][]*model.Books{}
其中
Student
是:

type Student struct{
    bookMap map[string][]*model.Books
}
我们有一个模型包

package model

type Books struct {
    bookName   string  `db:"Name"`
    bookAuthor string  `db:"Author"`
}

这意味着
struct
Student
的成员
bookMap
包含一个
map
,它将
字符串作为键,并将指向
model.Books
实例的指针数组(切片)作为值。

该语句正在将map
Student.bookMap
初始化为空映射(它具有以下结构:key->
字符串
,value->model.Books的指针切片