diff --git a/server/backend/internal/restapi/routes.go b/server/backend/internal/restapi/routes.go index be2a319..359d69e 100644 --- a/server/backend/internal/restapi/routes.go +++ b/server/backend/internal/restapi/routes.go @@ -27,6 +27,7 @@ const ManageHandshake = "/manage/handshake" const UpdateClientEncryptionStatus = "/encryption-status" const UpdateUserPassword = "/user/password" +//nolint:funlen // this function can be huge, it does not contain logic, only route directives func (h ServiceHandler) InitRoutes(router *mux.Router) { authenticateHandler := authenticate.Handler{Usecase: h.Usecase} diff --git a/server/frontend/internal/repository/repository.go b/server/frontend/internal/repository/repository.go index 58632e6..015fa42 100644 --- a/server/frontend/internal/repository/repository.go +++ b/server/frontend/internal/repository/repository.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -44,7 +45,7 @@ func (repo *Repository) checkUniformError(responseBytes []byte) (int, error) { return -1, err } if uniformResponse.Details != "" { - return uniformResponse.StatusCode, fmt.Errorf(uniformResponse.Details) + return uniformResponse.StatusCode, errors.New(uniformResponse.Details) } return -1, nil } @@ -156,7 +157,7 @@ func (repo *Repository) GetUserDevices(token string, page int) (*entities.Return } // Common CRUD operation handler -func (repo *Repository) executeAuthorizedRequest(method, endpoint string, token string, request, response interface{}) error { +func (repo *Repository) executeAuthorizedRequest(method, endpoint, token string, request, response any) error { headers := map[string]string{"Authorization": fmt.Sprintf("Bearer %s", token)} jsonData, err := json.Marshal(request)