From 573c99273a65181f1bd2a93b689de69907254fcb Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 14 Aug 2024 17:29:16 +0200 Subject: [PATCH] lint --- types/context_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/context_test.go b/types/context_test.go index 4ee00aac7408..81edab5274ba 100644 --- a/types/context_test.go +++ b/types/context_test.go @@ -18,6 +18,8 @@ import ( "github.com/cosmos/cosmos-sdk/types" ) +type dummyCtxKey struct{} + type contextTestSuite struct { suite.Suite } @@ -137,8 +139,7 @@ func (s *contextTestSuite) TestContextWithCustom() { s.Require().Equal(cp, ctx.WithConsensusParams(cp).ConsensusParams()) // test inner context - var ctxKey = struct{}{} - newContext := context.WithValue(ctx.Context(), ctxKey, "value") + newContext := context.WithValue(ctx.Context(), dummyCtxKey{}, "value") s.Require().NotEqual(ctx.Context(), ctx.WithContext(newContext).Context()) } @@ -226,8 +227,7 @@ func (s *contextTestSuite) TestUnwrapSDKContext() { s.Require().Panics(func() { types.UnwrapSDKContext(ctx) }) // test unwrapping when we've used context.WithValue - var ctxKey = struct{}{} - ctx = context.WithValue(sdkCtx, ctxKey, "bar") + ctx = context.WithValue(sdkCtx, dummyCtxKey{}, "bar") sdkCtx2 = types.UnwrapSDKContext(ctx) s.Require().Equal(sdkCtx, sdkCtx2) }