Skip to content

Conversation

@butuzov
Copy link

@butuzov butuzov commented Feb 18, 2018

I have update example code and update readme file for builder pattern.

my example and usage include complete implementation of initial builder example.

added example code
updated readme (code and usage example)
familyCar.Drive()

sportsCar := assembly.Wheels(car.SteelWheels).TopSpeed(150 * car.MPH).Build()
fmt.Printf("%#v\n", familyCar)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is useful in README to have fmt.Printf statements ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all, it's a Book. But yeah, I do agree, printing isn't really necessary here.

but still, its nice representation
fmt.Printf("%#s\n", sportsCar)
will give you
Red Car on sports wheels with top speed 150.00 mph

@butuzov butuzov closed this May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants