How to read multiple times from same io.Reader
<p>I want to use <code>request.Body(type io.ReadCloser)</code> which is containing a image.</p>

<p>I dont want to use <code>ioutil.ReadAll()</code> as i want to write this body directly to the file as well as want to decode it, so i only want to use the reference to the content to pass to further function calls, </p>

<p>I tried creating multiple instances of reader for example shown below</p>

<pre><code>package main

import (
    "io/ioutil"
    "log"
    "strings"
)


func main() {
    r := strings.NewReader("some io.Reader stream to be read\n")
    a := &amp;r
    b := &amp;r
    log.Println(ioutil.ReadAll(*a))
    log.Println(ioutil.ReadAll(*b))

}
</code></pre>

<p>but in second call it always results into <code>nil</code>.</p>

<p>Please help me how can i pass multiple separate reference for the same reader?</p>