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

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