Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-fischer committed Jun 21, 2024
1 parent fcfeb06 commit 2e2a656
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
1 change: 1 addition & 0 deletions management/server/grpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ func (s *GRPCServer) Login(ctx context.Context, req *proto.EncryptedMessage) (*p
return nil, err
}

//nolint
ctx = context.WithValue(ctx, nbContext.PeerIDKey, peerKey.String())
accountID, err := s.accountManager.GetAccountIDForPeerKey(peerKey.String())
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions management/server/http/middleware/auth_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func (m *AuthMiddleware) Handler(h http.Handler) http.Handler {
return
}
claims := m.claimsExtractor.FromRequestContext(r)
//nolint
ctx := context.WithValue(r.Context(), nbContext.UserIDKey, claims.UserId)
//nolint
ctx = context.WithValue(ctx, nbContext.AccountIDKey, claims.AccountId)
Expand Down
11 changes: 1 addition & 10 deletions management/server/telemetry/http_api_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package telemetry
import (
"context"
"fmt"
"hash/fnv"
"net/http"
"strings"
"time"
Expand Down Expand Up @@ -168,6 +167,7 @@ func (m *HTTPMiddleware) Handler(h http.Handler) http.Handler {
fn := func(rw http.ResponseWriter, r *http.Request) {
reqStart := time.Now()

//nolint
ctx := context.WithValue(r.Context(), util.LogSourceKey, util.HTTPSource)

reqID := uuid.New().String()
Expand Down Expand Up @@ -222,12 +222,3 @@ func (m *HTTPMiddleware) Handler(h http.Handler) http.Handler {

return http.HandlerFunc(fn)
}

func hash(s string) uint32 {
h := fnv.New32a()
_, err := h.Write([]byte(s))
if err != nil {
panic(err)
}
return h.Sum32()
}
2 changes: 1 addition & 1 deletion util/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (f *CustomFormatter) Format(entry *log.Entry) ([]byte, error) {
}
source, ok := entry.Context.Value(LogSourceKey).(LogSource)
if !ok {
f.TextFormatter.Format(entry)
return f.TextFormatter.Format(entry)
}

entry.Data["source"] = source
Expand Down

0 comments on commit 2e2a656

Please sign in to comment.