```go
&Client{
url: u,
userAgent: conf.UserAgent,
httpClient: &http.Client{
Timeout: conf.Timeout,
Transport: tr,
},
credentials: conf.Credentials,
}
```
请问这冒号代表的是什么意思?
Composite literals, 根据已经声明的类型构造复合的变量,类似于 key: value, 应该不是声明变量
type Point3D struct { x, y, z float64 }
type Line struct {
p, q Point3D
custom map[string]int
}
l := &Line{
p: Point3D{},
q: Point3D{y: -4, z: 12.3},
custom: map[string]int{
"weight": 1,
"color": 0,
},
}
The key is interpreted as a field name for struct literals, an index for array and slice literals, and a key for map literals. For map literals, all elements must have a key. It is an error to specify multiple elements with the same field name or constant key value.
For struct literals the following rules apply:
A key must be a field name declared in the struct type.
An element list that does not contain any keys must list an element for each struct field in the order in which the fields are declared.
If any element has a key, every element must have a key.
An element list that contains keys does not need to have an element for each struct field. Omitted fields get the zero value for that field.
A literal may omit the element list; such a literal evaluates to the zero value for its type.
It is an error to specify an element for a non-exported field of a struct belonging to a different package.
#5