3 ms·
> it's a huge value to future code readers if my new structure only accepts an interface with List and Get, or List and Delete. But that's not specific to gol
by za3faran 4y ago
> it's a huge value to future code readers if my new structure only accepts an interface with List and Get, or List and Delete.
But that's not specific to golang. You can use the same approach in Java, Kotlin, C#, etc
- cube2222 4y agoUnless I'm missing something, you then have to write wrappers that translate between the big and the small interfaces, or explicitly mark all interfaces as implemented at the original type definition point. The first one is a lot of boilerplate, the second one is not always possible.