Strategy
type (
Engine interface {
Output() float64
}
NaturalAspirated struct {
// Properties
}
Turbocharged struct {
// Properties
}
)
func (na NaturalAspirated) Output() float64 {
// Implementation...
return power
}
func (tc Turbocharged) Output() float64 {
// Implementation...
return power
}Last updated