Untitled
Anonymous
golang
12/16/2022 7:00 PM
308 B
24
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...