6 ms·
One common situation I’ve seen is when you have a core primitive like io.Reader then lots of “extension” functions that solely depend on the core interface like
by jasonthorsness 2y ago
One common situation I’ve seen is when you have a core primitive like io.Reader then lots of “extension” functions that solely depend on the core interface like io.ReadAll are implemented alongside in the same package. This lets you add functionality to all implementations of an interface and keeps the interface simple.