From f698feac9ccdf03728064618be732ceb5e8cb0f2 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Sun, 23 Aug 2020 14:11:57 +0100 Subject: [PATCH] remove context from client/server --- client/context.go | 16 ---------------- server/context.go | 16 ---------------- 2 files changed, 32 deletions(-) delete mode 100644 client/context.go delete mode 100644 server/context.go diff --git a/client/context.go b/client/context.go deleted file mode 100644 index 4cb496f0..00000000 --- a/client/context.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -import ( - "context" -) - -type clientKey struct{} - -func FromContext(ctx context.Context) (Client, bool) { - c, ok := ctx.Value(clientKey{}).(Client) - return c, ok -} - -func NewContext(ctx context.Context, c Client) context.Context { - return context.WithValue(ctx, clientKey{}, c) -} diff --git a/server/context.go b/server/context.go deleted file mode 100644 index fdd9ff75..00000000 --- a/server/context.go +++ /dev/null @@ -1,16 +0,0 @@ -package server - -import ( - "context" -) - -type serverKey struct{} - -func FromContext(ctx context.Context) (Server, bool) { - c, ok := ctx.Value(serverKey{}).(Server) - return c, ok -} - -func NewContext(ctx context.Context, s Server) context.Context { - return context.WithValue(ctx, serverKey{}, s) -}