以下代码创建了一个可用的struct实例Car.这与使用有new(Car)什么不同?
Car
new(Car)
例:
type Car struct { make string } func Main() { var car Car; // how is this different than "car := new(Car)"? car.make = "Honda" }
go
go ×1