The following code creates a usable instance of the struct, Car
. How is this different than using new(Car)
?
Example:
type Car struct {
make string
}
func Main() {
var car Car; // how is this different than "car := new(Car)"?
car.make = "Honda"
}