'Go Composed Interface Instance [duplicate]

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
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source