struct
类型定义
type Rect struct {
width, height float64
}声明语义
var rect Rect初始化方法
rect := new(Rect) # 指针
rect := &Rect{} # 指针
rect := &Rect{1.0, 2.0} # 指针
rect := &Rect{width: 1.0, height: 2.0} # 指针
rect := Rect{width: 1.0, height: 2.0} # 对象句柄成员函数
Last updated