mirror of
https://github.com/crazybber/awesome-patterns.git
synced 2024-11-22 12:46:03 +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{}
|
type MotorbikeFactory struct{}
|
||||||
|
|
||||||
func (m *MotorbikeFactory) Build(v int) (Vehicle, error) {
|
func (m *MotorbikeFactory) NewVehicle(v int) (Vehicle, error) {
|
||||||
switch v {
|
switch v {
|
||||||
case SportMotorbikeType:
|
case SportMotorbikeType:
|
||||||
return new(SportMotorbike), nil
|
return new(SportMotorbike), nil
|
||||||
|
Loading…
Reference in New Issue
Block a user