mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 23:14:02 +03:00
Update golangci-lint
This commit is contained in:
@@ -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
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user