[Golang] Builder

preview_player
Показать описание
Today, the builder pattern!

---
Golang version: 1.16
IDE: Goland
OS: Windows
Accent: French
Рекомендации по теме
Комментарии
Автор

Great beginner level intro, was easy to follow

rolandwarburton
Автор

"So `me`, I'm a `Human`"... Nice try reptilian lol. Nice video, I like the way you explain and show the code. A video about pointers (*, &, ...) would be really cool. I'm coming from python and I just let my IDE handle those things for me without really understanding what's going on.

pronoe
Автор

nice tutorial, im new in best practices of golang i read some articles that say no need to create builder pattern in golang since you can directly assign the value and if there is no logic inside the builder function, so my question when we use or not use the builder pattern and what is the best practice for assigning value to struct?

sidikridwan
Автор

where can i learn about this pattern extensively

abiodun
Автор

Nice video! I see you are using value receivers. Would it make any practical difference had you used pointer receivers e.g. *human? Is there a convention / better way to go about it when using the Builder pattern?

panteliskaramolegkos
Автор

This is missing a lot of points like having a separate HumanBuilder struct which is the one with all the methods (idiomatically named Age() and EyeColor(), not using the "with" prefix), and the Build() method that returns a Human and an error (you're not evaluating user input here.

I have to say that if you are a senior dev in your company, then I should be a CEO lol

necroowl
Автор

where can i learn about this pattern extensively

abiodun