File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ func (w *wildcardSub) Close() error {
133133 w .closeOnce .Do (func () {
134134 w .w .removeSink (w .ch )
135135 if w .metricsTracer != nil {
136- w .metricsTracer .RemoveSubscriber (reflect .TypeOf ( event .WildcardSubscription ))
136+ w .metricsTracer .RemoveSubscriber (reflect .TypeFor [ * event.wildcardSubscriptionType ]( ))
137137 }
138138 })
139139
@@ -345,7 +345,7 @@ func (n *wildcardNode) addSink(sink *namedSink) {
345345 n .Unlock ()
346346
347347 if n .metricsTracer != nil {
348- n .metricsTracer .AddSubscriber (reflect .TypeOf ( event .WildcardSubscription ))
348+ n .metricsTracer .AddSubscriber (reflect .TypeFor [ * event.wildcardSubscriptionType ]( ))
349349 }
350350}
351351
@@ -368,7 +368,7 @@ func (n *wildcardNode) removeSink(ch chan interface{}) {
368368 n .Unlock ()
369369}
370370
371- var wildcardType = reflect .TypeOf ( event .WildcardSubscription )
371+ var wildcardType = reflect .TypeFor [ * event.wildcardSubscriptionType ]( )
372372
373373func (n * wildcardNode ) emit (evt interface {}) {
374374 if n .nSinks .Load () == 0 {
Original file line number Diff line number Diff line change @@ -113,15 +113,15 @@ func TestGetAllEventTypes(t *testing.T) {
113113
114114 evts := bus .GetAllEventTypes ()
115115 require .Len (t , evts , 1 )
116- require .Equal (t , reflect .TypeOf (( * EventB )( nil )). Elem (), evts [0 ])
116+ require .Equal (t , reflect .TypeFor [ EventB ] (), evts [0 ])
117117
118118 _ , err = bus .Emitter (new (EventA ))
119119 require .NoError (t , err )
120120
121121 evts = bus .GetAllEventTypes ()
122122 require .Len (t , evts , 2 )
123- require .Contains (t , evts , reflect .TypeOf (( * EventB )( nil )). Elem ())
124- require .Contains (t , evts , reflect .TypeOf (( * EventA )( nil )). Elem ())
123+ require .Contains (t , evts , reflect .TypeFor [ EventB ] ())
124+ require .Contains (t , evts , reflect .TypeFor [ EventA ] ())
125125}
126126
127127func TestEmitNoSubNoBlock (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments