Untitled
unknown
golang
3 years ago
229 B
8
Indexable
type Vehicle struct {
Seats int
Color string
}
type Car struct {
Vehicle
}
func main() {
car := &Car{
Vehicle{
Seats: 4,
Color: "blue",
},
}
fmt.Println(car.Seats)
fmt.Println(car.Color)
}Editor is loading...