From the course: Deep Dive Into Go Lang Interfaces
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Solution: Interface design
From the course: Deep Dive Into Go Lang Interfaces
Solution: Interface design
“
(lively music) - [Instructor] Let's have a look at my solution. So the Puller interface finds a single method called Pull, so it's a small interface, which is great. And here we take performance into consideration. We tell the user: you provide me the record, and I'll fill it in. So instead of having us needing to allocate a record every time, it's up to the user to decide if they want to give us the same record to fill over and over again or to allocate a new one every time.
Contents
-
-
-
-
(Locked)
Say what you need, not what you provide1m 48s
-
Case study: Analyzing sort.Interface2m 28s
-
(Locked)
Embedding interfaces1m 54s
-
(Locked)
Using type assertion to keep the interface small5m 43s
-
(Locked)
Design for performance3m 28s
-
(Locked)
Challenge: Interface design21s
-
(Locked)
Solution: Interface design36s
-
(Locked)
-
-
-
-