Remove dead code paths

These paths were unreachable because XTransport.Get already checks the same conditions.
This commit is contained in:
William Elwood 2019-10-30 01:33:20 +00:00 committed by Frank Denis
parent af0629856c
commit 03dea47130
1 changed files with 1 additions and 8 deletions

View File

@ -1,7 +1,6 @@
package main
import (
"errors"
"fmt"
"io"
"io/ioutil"
@ -95,13 +94,7 @@ func fetchWithCache(xTransport *XTransport, urlStr string, cacheFile string, ref
return
}
resp, _, err = xTransport.Get(url, "", 30*time.Second)
if err == nil && resp != nil && (resp.StatusCode < 200 || resp.StatusCode > 299) {
err = fmt.Errorf("Webserver returned code %d", resp.StatusCode)
return
} else if err != nil {
return
} else if resp == nil {
err = errors.New("Webserver returned an error")
if err != nil {
return
}
var bin []byte