News for hackers. Stuff that matters.
Re:Stunned by Go by enneff on Wednesday July 17, 2013 @08:25PM (#6060924)
Yes, easily:

    var rc io.ReadCloser // a file, whatever
    readerOnly := struct{io.Reader}{rc} // only a Reader
Re:Stunned by Go by frou_dh on Wednesday July 17, 2013 @09:41PM (#6061244)
That's cool. The io.Reader is an unnamed field, so its method is effectively pushed to the surface of the wrapping struct instead of needing to be explicitly forwarded to.