diff --git a/v2/client/receiver_test.go b/v2/client/receiver_test.go index f373ba5e2..a24195e07 100644 --- a/v2/client/receiver_test.go +++ b/v2/client/receiver_test.go @@ -87,6 +87,8 @@ func TestReceiverFnInvalidTypes(t *testing.T) { func TestReceiverFnInvoke_1(t *testing.T) { key := struct{}{} + + //nolint:staticcheck wantCtx := context.WithValue(context.TODO(), key, "UNIT TEST") wantEvent := event.Event{ Context: &event.EventContextV1{ID: "UNIT TEST"}, @@ -124,6 +126,8 @@ func TestReceiverFnInvoke_1(t *testing.T) { func TestReceiverFnInvoke_2(t *testing.T) { key := struct{}{} + + //nolint:staticcheck ctx := context.WithValue(context.TODO(), key, "UNIT TEST") wantEvent := event.Event{ Context: &event.EventContextV1{ @@ -158,6 +162,8 @@ func TestReceiverFnInvoke_2(t *testing.T) { func TestReceiverFnInvoke_3(t *testing.T) { key := struct{}{} + + //nolint:staticcheck ctx := context.WithValue(context.TODO(), key, "UNIT TEST") wantEvent := event.Event{ Context: &event.EventContextV1{ @@ -192,6 +198,8 @@ func TestReceiverFnInvoke_3(t *testing.T) { func TestReceiverFnInvoke_4(t *testing.T) { key := struct{}{} + + //nolint:staticcheck ctx := context.WithValue(context.TODO(), key, "UNIT TEST") wantResp := &event.Event{ Context: &event.EventContextV1{ID: "UNIT TEST"}, @@ -218,6 +226,8 @@ func TestReceiverFnInvoke_4(t *testing.T) { func TestReceiverFnInvoke_5(t *testing.T) { key := struct{}{} + + //nolint:staticcheck ctx := context.WithValue(context.TODO(), key, "UNIT TEST") var wantResp *event.Event diff --git a/v2/event/eventcontext_v03.go b/v2/event/eventcontext_v03.go index 3f0505547..fc67521a2 100644 --- a/v2/event/eventcontext_v03.go +++ b/v2/event/eventcontext_v03.go @@ -314,7 +314,7 @@ func (ec EventContextV03) String() string { b.WriteString(" datacontentencoding: " + *ec.DataContentEncoding + "\n") } - if ec.Extensions != nil && len(ec.Extensions) > 0 { + if len(ec.Extensions) > 0 { b.WriteString("Extensions,\n") keys := make([]string, 0, len(ec.Extensions)) for k := range ec.Extensions { diff --git a/v2/event/eventcontext_v1.go b/v2/event/eventcontext_v1.go index 8f164502b..df311657f 100644 --- a/v2/event/eventcontext_v1.go +++ b/v2/event/eventcontext_v1.go @@ -299,7 +299,7 @@ func (ec EventContextV1) String() string { b.WriteString(" datacontenttype: " + *ec.DataContentType + "\n") } - if ec.Extensions != nil && len(ec.Extensions) > 0 { + if len(ec.Extensions) > 0 { b.WriteString("Extensions,\n") keys := make([]string, 0, len(ec.Extensions)) for k := range ec.Extensions {