4.5.3-2c Underlying Type
int // 申明一个 int 类型
map[string]bool // 申明一个 map 类型
<- chan int // 申明一个 channel 类型
struct {/* 忽略 Fields */} // 申明一个 struct 类型
interface { /* 忽略方法申明 */ } // 申明一个 interface 类型func f(s struct {
name string
age int
})
func main() {
f(struct {
name string
age int
}{"golang", 12})
}最后更新于