Skip to content

Commit

Permalink
fix lint errs
Browse files Browse the repository at this point in the history
  • Loading branch information
adwski committed May 15, 2024
1 parent 47d6521 commit 733951f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions internal/api/requestid/requestid.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package requestid

import (
"context"

"github.com/gofrs/uuid/v5"
"go.uber.org/zap"
"google.golang.org/grpc"
Expand Down
12 changes: 7 additions & 5 deletions internal/api/requestid/requestid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ package requestid

import (
"context"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
"google.golang.org/grpc/metadata"
"testing"
)

func TestGenerator_InterceptorFunc(t *testing.T) {
type args struct {
trust bool
reqID string
trust bool
empty bool
}
type want struct {
Expand Down Expand Up @@ -76,11 +77,12 @@ func TestGenerator_InterceptorFunc(t *testing.T) {
require.NotNil(t, interceptor)

var ctx context.Context
if tt.args.reqID != "" {
switch {
case tt.args.reqID != "":
ctx = metadata.NewIncomingContext(context.Background(), metadata.Pairs(xRequestIDField, tt.args.reqID))
} else if tt.args.empty {
case tt.args.empty:
ctx = metadata.NewIncomingContext(context.Background(), metadata.Pairs(xRequestIDField, ""))
} else {
default:
ctx = context.Background()
}

Expand Down

0 comments on commit 733951f

Please sign in to comment.