3 ms·
> whereas the contract version would be "a slice of a type that implements io.Reader" but it would have to all be the same type. From what I understand, you co
by JelteF 7y ago
> whereas the contract version would be "a slice of a type that implements io.Reader" but it would have to all be the same type.
From what I understand, you could still pass a []io.Reader to a contract version of the function. A slice of interfaces would still implement the contract (and is the same type, i.e. io.Reader). However, you could also pass a []os.File, which is not possible to do with the interface version of the function.
- jerf 7y agoSorry, yes, in Go, they could all be "an interface value that is io.Reader" as well. But that is still a subtly different flavor than what the current []io.Reader means.