Update golangci-lint

This commit is contained in:
9seconds
2022-08-08 15:54:38 +03:00
parent 6a19ded78e
commit 36dad5a2f6
70 changed files with 227 additions and 214 deletions
+8
View File
@@ -0,0 +1,8 @@
// files defines a set of abstraction for 'files': an openable entities that
// could be read after.
//
// This is not a file on a filesystem of your local machine, it also can
// include "in memory" files or even remote ones, like HTTP endpoints. If you
// make a GET request to HTTP endpoint, then a body is readable and you can
// consider it as an openable file.
package files
+1 -1
View File
@@ -22,7 +22,7 @@ func (h httpFile) Open(ctx context.Context) (io.ReadCloser, error) {
response, err := h.http.Do(request)
if err != nil {
if response != nil {
io.Copy(io.Discard, response.Body) // nolint: errcheck
io.Copy(io.Discard, response.Body) //nolint: errcheck
response.Body.Close()
}
+1 -1
View File
@@ -22,7 +22,7 @@ type HTTPTestSuite struct {
}
func (suite *HTTPTestSuite) makeFile(path string) (files.File, error) {
return files.NewHTTP(suite.httpClient, suite.httpServer.URL+"/"+path) // nolint: wrapcheck
return files.NewHTTP(suite.httpClient, suite.httpServer.URL+"/"+path) //nolint: wrapcheck
}
func (suite *HTTPTestSuite) SetupSuite() {
+1 -1
View File
@@ -12,7 +12,7 @@ type localFile struct {
}
func (l localFile) Open(ctx context.Context) (io.ReadCloser, error) {
return os.Open(l.path) // nolint: wrapcheck
return os.Open(l.path) //nolint: wrapcheck
}
func (l localFile) String() string {
+2 -2
View File
@@ -19,8 +19,8 @@ import (
var (
fireholRegexpComment = regexp.MustCompile(`\s*#.*?$`)
fireholIPv4DefaultCIDR = net.CIDRMask(32, 32) // nolint: gomnd
fireholIPv6DefaultCIDR = net.CIDRMask(128, 128) // nolint: gomnd
fireholIPv4DefaultCIDR = net.CIDRMask(32, 32) //nolint: gomnd
fireholIPv6DefaultCIDR = net.CIDRMask(128, 128) //nolint: gomnd
)
// FireholUpdateCallback defines a signature of the callback that has to be
+1 -1
View File
@@ -37,7 +37,7 @@ func (suite *FireholTestSuite) SetupSuite() {
defer filefp.Close()
io.Copy(w, filefp) // nolint: errcheck
io.Copy(w, filefp) //nolint: errcheck
})
suite.httpServer = httptest.NewServer(mux)