Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Virgula0 committed Feb 12, 2025
1 parent ef3ed7d commit 43b7614
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions server/backend/internal/restapi/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
5 changes: 3 additions & 2 deletions server/frontend/internal/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 43b7614

Please sign in to comment.