Closed
Description
by elazarl:
1. Create a new response 2. Write the response twice 3. The error you'll receive is, "http: invalid Read on closed request Body", which is confusing, s/request/request or response/. For example http://play.golang.org/p/tBwXSkWhMG func main() { req, _ := http.NewRequest("GET", "http://google.com";, strings.NewReader("")) resp, _ := http.ReadResponse( bufio.NewReader(strings.NewReader( "HTTP/1.1 200 OK\r\n"+ "Content-Type: text/plain\r\n"+ "Content-Length: 1\r\n\r\na")), req) resp.Write(ioutil.Discard) fmt.Println(resp.Write(ioutil.Discard)) } [1] http://tip.golang.org/src/pkg/net/http/transfer.go#L528