@@ -143,7 +143,7 @@ func setContext(event api.CDEventWriter, subjectId string) {
143143 event .SetSubjectId (subjectId )
144144}
145145
146- func setContextV04 (event api.CDEventWriterV04 , chainId , schemaUri bool ) {
146+ func setContextV04 (event api.CDEventWriterV04 , chainId , schemaUri bool ) { //nolint: unparam
147147 if chainId {
148148 event .SetChainId (testChainId )
149149 }
@@ -239,7 +239,6 @@ func init() {
239239// TestAsCloudEvent produces a CloudEvent from a CDEvent using `AsCloudEvent`
240240// and then attempts to parse the CloudEvent payload back into a specific CDEvent
241241func TestAsCloudEvent (t * testing.T ) {
242-
243242 tests := []struct {
244243 name string
245244 event api.CDEventReader
@@ -309,7 +308,6 @@ func TestAsCloudEvent(t *testing.T) {
309308}
310309
311310func TestAsCloudEventInvalid (t * testing.T ) {
312-
313311 tests := []struct {
314312 name string
315313 event api.CDEventReader
@@ -353,7 +351,6 @@ func TestAsCloudEventInvalid(t *testing.T) {
353351// rendered JSON depends on a number of factors, and is not deterministic
354352// so we must compare events unmarshalled to an interface
355353func TestAsJsonBytes (t * testing.T ) {
356-
357354 tests := []struct {
358355 name string
359356 event api.CDEvent
@@ -393,7 +390,7 @@ func TestAsJsonBytes(t *testing.T) {
393390 if err != nil {
394391 t .Fatalf ("didn't expected it to fail, but it did: %v" , err )
395392 }
396- err = json .Unmarshal ([] byte ( obtainedJsonString ) , & obtainedInteface )
393+ err = json .Unmarshal (obtainedJsonString , & obtainedInteface )
397394 if err != nil {
398395 t .Fatalf ("didn't expected it to fail, but it did: %v" , err )
399396 }
@@ -409,7 +406,6 @@ func TestAsJsonBytes(t *testing.T) {
409406}
410407
411408func TestInvalidEvent (t * testing.T ) {
412-
413409 // mandatory source missing
414410 eventNoSource , _ := testapi .NewFooSubjectBarPredicateEvent ()
415411 eventNoSource .SetSubjectId (testSubjectId )
@@ -506,7 +502,6 @@ func TestAsJsonStringEmpty(t *testing.T) {
506502}
507503
508504func TestNewFromJsonString (t * testing.T ) {
509-
510505 tests := []struct {
511506 name string
512507 event api.CDEventV04
@@ -582,7 +577,6 @@ func TestNewFromJsonString(t *testing.T) {
582577}
583578
584579func TestParseType (t * testing.T ) {
585-
586580 tests := []struct {
587581 name string
588582 eventType string
@@ -668,7 +662,6 @@ func testEventWithVersion(eventVersion string, specVersion string) *testapi.FooS
668662}
669663
670664func TestNewFromJsonBytes (t * testing.T ) {
671-
672665 minorVersion := testEventWithVersion ("2.999.1" , testapi .SpecVersion )
673666 patchVersion := testEventWithVersion ("2.2.999" , testapi .SpecVersion )
674667 pastPatchVersion := testEventWithVersion ("2.2.0" , testapi .SpecVersion )
0 commit comments