2022-02-10 17:50:31 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
// Vehicle defines the vehicle behavior
|
|
|
|
type Vehicle interface {
|
|
|
|
// Run vehicle can run in a speed
|
|
|
|
Run()
|
|
|
|
}
|
|
|
|
|
2024-06-25 13:16:58 +00:00
|
|
|
// BMWS1000RR defines the motorcycle bmw s1000rr
|
2022-02-10 17:50:31 +00:00
|
|
|
type BMWS1000RR struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
// Run bwm s1000rr run
|
|
|
|
func (a *BMWS1000RR) Run() {
|
|
|
|
println("I can run at 300km/h")
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
var vehicle Vehicle = &BMWS1000RR{}
|
|
|
|
vehicle.Run()
|
|
|
|
}
|