rpc: remove NotifierContextKey
Context keys must have a unique type in order to prevent any unintented clashes. The code used int(1) as key. Fix it by implementing the pattern recommended by package context.
This commit is contained in:
@ -36,7 +36,7 @@ func (s *NotificationTestService) Unsubscribe(subid string) {
|
||||
}
|
||||
|
||||
func (s *NotificationTestService) SomeSubscription(ctx context.Context, n, val int) (Subscription, error) {
|
||||
notifier, supported := ctx.Value(NotifierContextKey).(Notifier)
|
||||
notifier, supported := NotifierFromContext(ctx)
|
||||
if !supported {
|
||||
return nil, ErrNotificationsUnsupported
|
||||
}
|
||||
|
Reference in New Issue
Block a user