3 ms·
This is also the style advocated by the standard library. See for example the helper functions for io.Reader: https://golang.org/pkg/io/#Reader https://golang.o
by majewsky 10y ago
This is also the style advocated by the standard library. See for example the helper functions for io.Reader: https://golang.org/pkg/io/#Reader https://golang.org/pkg/io/#Reader
For example, `io.TeeReader` returns `io.Reader` (the interface). The underlying type that implements the tee functionality is left private because you don't need to be able to see it. It really drives home the point that the return value is "just another io.Reader".