mirror of
https://github.com/crazybber/awesome-patterns.git
synced 2024-11-21 20:36:01 +03:00
Change Build for NewVehicle in motorbike_factory
* To implements VehicleFactory the name of the function is changed
This commit is contained in:
parent
b50ddf6eff
commit
ffebe52a4f
@ -12,7 +12,7 @@ const (
|
||||
|
||||
type MotorbikeFactory struct{}
|
||||
|
||||
func (m *MotorbikeFactory) Build(v int) (Vehicle, error) {
|
||||
func (m *MotorbikeFactory) NewVehicle(v int) (Vehicle, error) {
|
||||
switch v {
|
||||
case SportMotorbikeType:
|
||||
return new(SportMotorbike), nil
|
||||
|
Loading…
Reference in New Issue
Block a user