title: Convert io.ReadCloser into io.Reader in Go
body: <p>I am using the <code>archive/zip</code> library and I need to make a modification to a file inside a zip archive on the fly before I upload it to s3. Currently I am getting back an <code>io.ReadCloser</code> but the function I am using to modify the user requires an <code>io.Reader</code>:</p>
  
  <pre><code>//Function Signature:
  Convert(r io.Reader, w io.Writer, ...)
  </code></pre>
  
  <p>I also need an <code>io.Writer</code>... Bonus points if you can help me determine how to create a writer as well. Here is some example code that may give some context:</p>
  
  <pre><code>for _, f := range r.File {
      if filepath.Ext(f.Name) != ".txt" {
  
        _, filename := path.Split(f.Name)
        var rc io.ReadCloser
        if rc, err = f.Open(); err == nil {
  
          // FIXME: Convert
          if err = Convert(rc.Reader, *zip.Writer.Create(f.Name), ...); err != nil {
            errStr := fmt.Sprintf("Unable to convert")
            log.Println(errStr)
  
          } else {
  
            log.Println("Success!")
  
          }
  
          // Upload to s3
          .....
        }   
      }   
    }
  </code></pre>