fixed read on closed body
This commit is contained in:
@@ -128,10 +128,7 @@ func (dp *DemoParser) ParseDemo(demo *Demo) error {
|
|||||||
func (d *Demo) download() (io.Reader, error) {
|
func (d *Demo) download() (io.Reader, error) {
|
||||||
log.Debugf("[DP] Downloading replay for %d", d.MatchID)
|
log.Debugf("[DP] Downloading replay for %d", d.MatchID)
|
||||||
|
|
||||||
r, err := http.Get(d.URL)
|
r, err := http.Get(d.URL) //nolint:bodyclose,noctx
|
||||||
defer func(Body io.ReadCloser) {
|
|
||||||
_ = Body.Close()
|
|
||||||
}(r.Body)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user