ignore the static check when using anonymous struct in testing

Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
This commit is contained in:
Akhil Mohan 2024-08-14 14:50:39 +05:30
parent f8e0753366
commit 1027b314a6
No known key found for this signature in database
GPG Key ID: BA8C85CD8F373329

View File

@ -27,7 +27,7 @@ func TestBackground(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
var k struct{} var k struct{}
v := "incontext" v := "incontext"
ctx = context.WithValue(ctx, k, v) ctx = context.WithValue(ctx, k, v) //nolint:staticcheck
assert.Nil(t, contextError(ctx)) assert.Nil(t, contextError(ctx))
assert.Equal(t, ctx.Value(k), v) assert.Equal(t, ctx.Value(k), v)