Episode 6! - Watch and learn how you can use type assertions to write simple, yet effective, code. -- In this video, Miki will write a versatile logging library with Go interfaces.The first prototype he proposes consists of a type with an `io.Writer` interface field to handle writing data for the logger. Upon completing the first design, Miki realizes his type is missing a `Sync` function, which will enable developers to move data into stable storage while logging. To meet this requirement, Miki will create a new interface type with a `Sync` function.
Things you will learn in this video :
How to properly perform a type assertion on an interface.
How to move data from memory to stable storage.
Tips on designing an interface in Go.
For the full course materials visit → https://github.com/ardanlabs/gotraini...
--
Do you agree with the Go proverb : “the bigger the interface the weaker the abstraction”?
Comment below or tweet us on twitter & let us know, we want to hear from you! ~ If you found this video helpful, hit that like button & subscribe for more content like this.
--
Access our online courses → https://ardanlabs.com/education
Attending a live training → https://www.ardanlabs.com/live-traini...
Other Links:
Website: https://www.ardanlabs.com/
Github: https://github.com/ardanlabs
Twitter: / ardanlabs
Смотрите видео Interfaces 101 : Interface Type Assertion онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Ardan Labs 06 Март 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,418 раз и оно понравилось 33 людям.