Change Build for NewVehicle in motorbike_factory

* To implements VehicleFactory the name of the function
	  is changed
This commit is contained in:
Lucas Alves 2021-07-01 00:55:09 -03:00
parent b50ddf6eff
commit ffebe52a4f

View File

@ -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