aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/notification_test.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-04-16 00:05:24 +0800
committerFelix Lange <fjl@twurst.com>2016-04-16 00:10:52 +0800
commita40e61b4ac44a4f64f057a4220a26cfe4b9dcf03 (patch)
tree401218a5f3ed5b4fac88baf87551bd3f57f3c34b /rpc/notification_test.go
parent6197fbf8d70c1aa96c3e87de91ff3f46f454c1ea (diff)
downloaddexon-a40e61b4ac44a4f64f057a4220a26cfe4b9dcf03.tar
dexon-a40e61b4ac44a4f64f057a4220a26cfe4b9dcf03.tar.gz
dexon-a40e61b4ac44a4f64f057a4220a26cfe4b9dcf03.tar.bz2
dexon-a40e61b4ac44a4f64f057a4220a26cfe4b9dcf03.tar.lz
dexon-a40e61b4ac44a4f64f057a4220a26cfe4b9dcf03.tar.xz
dexon-a40e61b4ac44a4f64f057a4220a26cfe4b9dcf03.tar.zst
dexon-a40e61b4ac44a4f64f057a4220a26cfe4b9dcf03.zip
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.
Diffstat (limited to 'rpc/notification_test.go')
-rw-r--r--rpc/notification_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/rpc/notification_test.go b/rpc/notification_test.go
index cd05d73fe..1bcede177 100644
--- a/rpc/notification_test.go
+++ b/rpc/notification_test.go
@@ -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
}