For a composite interface e.g.
type io.ReadWriter interface {
io.Reader
io.Writer
}
Is it possible to wrap the implementation instance on the fly from separate partial implementations without defining intermediate proxy structures types
func() io.ReadWriter {
var reader io.Reader
var writer io.Writer
return ...
}
e.g. something like io.ReadWriter{reader, writer}
.
Or is the most shorthand inline approach would be only like this?
return struct{
io.Reader
io.Writer
}{
reader,
writer
}