diff --git a/api/mojang/queue/queue_test.go b/api/mojang/queue/queue_test.go index 26eb19c..5d8c97c 100644 --- a/api/mojang/queue/queue_test.go +++ b/api/mojang/queue/queue_test.go @@ -254,7 +254,7 @@ func (suite *queueTestSuite) TestReceiveTexturesForUsernameWithCachedUnknownUuid } func (suite *queueTestSuite) TestReceiveTexturesForMoreThan100Usernames() { - usernames := make([]string, 120, 120) + usernames := make([]string, 120) for i := 0; i < 120; i++ { usernames[i] = randStr(8) } diff --git a/http/api_test.go b/http/api_test.go index 2d44e18..61c622d 100644 --- a/http/api_test.go +++ b/http/api_test.go @@ -78,7 +78,7 @@ func TestConfig_PostSkin(t *testing.T) { writer := multipart.NewWriter(body) part, _ := writer.CreateFormFile("skin", "char.png") - part.Write(loadSkinFile()) + _, _ = part.Write(loadSkinFile()) _ = writer.WriteField("identityId", "1") _ = writer.WriteField("username", "mock_user") @@ -332,7 +332,7 @@ func TestConfig_PostSkin(t *testing.T) { req.Header.Add("Authorization", "Bearer invalid.jwt.token") w := httptest.NewRecorder() - mocks.Auth.EXPECT().Check(gomock.Any()).Return(&auth.Unauthorized{"Cannot parse passed JWT token"}) + mocks.Auth.EXPECT().Check(gomock.Any()).Return(&auth.Unauthorized{Reason: "Cannot parse passed JWT token"}) mocks.Log.EXPECT().IncCounter("authentication.challenge", int64(1)) mocks.Log.EXPECT().IncCounter("authentication.failed", int64(1)) @@ -389,7 +389,7 @@ func TestConfig_DeleteSkinByUserId(t *testing.T) { w := httptest.NewRecorder() mocks.Auth.EXPECT().Check(gomock.Any()).Return(nil) - mocks.Skins.EXPECT().FindByUserId(2).Return(nil, &db.SkinNotFoundError{"unknown"}) + mocks.Skins.EXPECT().FindByUserId(2).Return(nil, &db.SkinNotFoundError{Who: "unknown"}) mocks.Log.EXPECT().IncCounter("authentication.challenge", int64(1)) mocks.Log.EXPECT().IncCounter("authentication.success", int64(1)) mocks.Log.EXPECT().IncCounter("api.skins.delete.request", int64(1)) @@ -448,7 +448,7 @@ func TestConfig_DeleteSkinByUsername(t *testing.T) { w := httptest.NewRecorder() mocks.Auth.EXPECT().Check(gomock.Any()).Return(nil) - mocks.Skins.EXPECT().FindByUsername("mock_user_2").Return(nil, &db.SkinNotFoundError{"mock_user_2"}) + mocks.Skins.EXPECT().FindByUsername("mock_user_2").Return(nil, &db.SkinNotFoundError{Who: "mock_user_2"}) mocks.Log.EXPECT().IncCounter("authentication.challenge", int64(1)) mocks.Log.EXPECT().IncCounter("authentication.success", int64(1)) mocks.Log.EXPECT().IncCounter("api.skins.delete.request", int64(1)) @@ -482,7 +482,7 @@ func TestConfig_Authenticate(t *testing.T) { mocks.Log.EXPECT().IncCounter("authentication.challenge", int64(1)) mocks.Log.EXPECT().IncCounter("authentication.failed", int64(1)) - res := config.Authenticate(http.HandlerFunc(func (resp http.ResponseWriter, req *http.Request) {})) + res := config.Authenticate(http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {})) res.ServeHTTP(w, req) resp := w.Result() diff --git a/http/cape.go b/http/cape.go index afa806b..7753fbd 100644 --- a/http/cape.go +++ b/http/cape.go @@ -16,7 +16,7 @@ func (cfg *Config) Cape(response http.ResponseWriter, request *http.Request) { rec, err := cfg.CapesRepo.FindByUsername(username) if err == nil { request.Header.Set("Content-Type", "image/png") - io.Copy(response, rec.File) + _, _ = io.Copy(response, rec.File) return }