mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Fix some linter issues
This commit is contained in:
parent
3eb3ac06b6
commit
cecab91298
69 changed files with 73 additions and 176 deletions
|
@ -29,10 +29,9 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
errInvalidCertificate = "Invalid SSL certificate (original error: %q)"
|
||||
errTemporaryNetworkOperation = "This website is temporarily unreachable (original error: %q)"
|
||||
errPermanentNetworkOperation = "This website is permanently unreachable (original error: %q)"
|
||||
errRequestTimeout = "Website unreachable, the request timed out after %d seconds"
|
||||
errInvalidCertificate = "Invalid SSL certificate (original error: %q)"
|
||||
errNetworkOperation = "This website is unreachable (original error: %q)"
|
||||
errRequestTimeout = "Website unreachable, the request timed out after %d seconds"
|
||||
)
|
||||
|
||||
// Client builds and executes HTTP requests.
|
||||
|
@ -205,17 +204,11 @@ func (c *Client) executeRequest(request *http.Request) (*Response, error) {
|
|||
case x509.CertificateInvalidError, x509.HostnameError:
|
||||
err = errors.NewLocalizedError(errInvalidCertificate, uerr.Err)
|
||||
case *net.OpError:
|
||||
if uerr.Err.(*net.OpError).Temporary() {
|
||||
err = errors.NewLocalizedError(errTemporaryNetworkOperation, uerr.Err)
|
||||
} else {
|
||||
err = errors.NewLocalizedError(errPermanentNetworkOperation, uerr.Err)
|
||||
}
|
||||
err = errors.NewLocalizedError(errNetworkOperation, uerr.Err)
|
||||
case net.Error:
|
||||
nerr := uerr.Err.(net.Error)
|
||||
if nerr.Timeout() {
|
||||
err = errors.NewLocalizedError(errRequestTimeout, c.ClientTimeout)
|
||||
} else if nerr.Temporary() {
|
||||
err = errors.NewLocalizedError(errTemporaryNetworkOperation, nerr)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
/*
|
||||
|
||||
Package client provides an HTTP client builder.
|
||||
|
||||
*/
|
||||
package client // import "miniflux.app/http/client"
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
/*
|
||||
|
||||
Package cookie provides functions to build cookies.
|
||||
|
||||
*/
|
||||
package cookie // import "miniflux.app/http/cookie"
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
/*
|
||||
|
||||
Package request contains helper functions to work with the HTTP request.
|
||||
|
||||
*/
|
||||
package request // import "miniflux.app/http/request"
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
/*
|
||||
|
||||
Package response contains everything related to HTTP responses.
|
||||
|
||||
*/
|
||||
package response // import "miniflux.app/http/response"
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
/*
|
||||
|
||||
Package html contains HTML response functions.
|
||||
|
||||
*/
|
||||
package html // import "miniflux.app/http/response/html"
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
/*
|
||||
|
||||
Package json contains JSON response functions.
|
||||
|
||||
*/
|
||||
package json // import "miniflux.app/http/response/json"
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
/*
|
||||
|
||||
Package xml contains XML response functions.
|
||||
|
||||
*/
|
||||
package xml // import "miniflux.app/http/response/xml"
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
/*
|
||||
|
||||
Package route contains helper functions to work with defined routes.
|
||||
|
||||
*/
|
||||
package route // import "miniflux.app/http/route"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue