mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
all: Remove unused code
Using x/tools/cmd/deadcode
This commit is contained in:
@@ -65,7 +65,6 @@ func responseToData(res *http.Response, readBody bool) map[string]any {
|
||||
}
|
||||
|
||||
return m
|
||||
|
||||
}
|
||||
|
||||
func toHTTPError(err error, res *http.Response, readBody bool) *HTTPError {
|
||||
@@ -141,7 +140,6 @@ func (c *Client) FromRemote(uri string, optionsm map[string]any) (resource.Resou
|
||||
if res.StatusCode != http.StatusNotFound {
|
||||
if res.StatusCode < 200 || res.StatusCode > 299 {
|
||||
return nil, temporaryHTTPStatusCodes[res.StatusCode], toHTTPError(fmt.Errorf("failed to fetch remote resource: %s", http.StatusText(res.StatusCode)), res, !isHeadMethod)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,9 +149,7 @@ func (c *Client) FromRemote(uri string, optionsm map[string]any) (resource.Resou
|
||||
}
|
||||
|
||||
return b, false, nil
|
||||
|
||||
}()
|
||||
|
||||
if err != nil {
|
||||
if retry {
|
||||
if start.IsZero() {
|
||||
@@ -174,7 +170,6 @@ func (c *Client) FromRemote(uri string, optionsm map[string]any) (resource.Resou
|
||||
return hugio.ToReadCloser(bytes.NewReader(b)), nil
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -307,22 +302,6 @@ func addUserProvidedHeaders(headers map[string]any, req *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
func hasHeaderValue(m http.Header, key, value string) bool {
|
||||
var s []string
|
||||
var ok bool
|
||||
|
||||
if s, ok = m[key]; !ok {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, v := range s {
|
||||
if v == value {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func hasHeaderKey(m http.Header, key string) bool {
|
||||
_, ok := m[key]
|
||||
return ok
|
||||
|
Reference in New Issue
Block a user