// If the Body is nil (or http.NoBody), it's safe to reuse
// this request and its Body.
ifreq.Body==nil||reqBodyIsNoBody(req.Body){
returnreq,nil
}
// Otherwise we depend on the Request having its GetBody
// func defined.
getBody:=reqGetBody(req)// Go 1.8: getBody = req.GetBody
ifgetBody==nil{
returnnil,errors.New("http2: Transport: peer server initiated graceful shutdown after some of Request.Body was written; define Request.GetBody to avoid this error")