From 1533a2c8c5d23bc5230ac8fcb2f175d203fbc939 Mon Sep 17 00:00:00 2001 From: Waldemar Quevedo Date: Mon, 10 Apr 2017 11:05:44 -0700 Subject: [PATCH] Remove calling panic in client on nil Context --- context.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/context.go b/context.go index ab93b2df6..e6e494963 100644 --- a/context.go +++ b/context.go @@ -13,9 +13,6 @@ import ( // RequestWithContext takes a context, a subject and payload // in bytes and request expecting a single response. func (nc *Conn) RequestWithContext(ctx context.Context, subj string, data []byte) (*Msg, error) { - if ctx == nil { - panic("nil context") - } inbox := NewInbox() ch := make(chan *Msg, RequestChanLen) @@ -38,9 +35,6 @@ func (nc *Conn) RequestWithContext(ctx context.Context, subj string, data []byte // available to a synchronous subscriber, blocking until it is delivered // or context gets canceled. func (s *Subscription) NextMsgWithContext(ctx context.Context) (*Msg, error) { - if ctx == nil { - panic("nil context") - } if s == nil { return nil, ErrBadSubscription } @@ -79,9 +73,6 @@ func (s *Subscription) NextMsgWithContext(ctx context.Context) (*Msg, error) { // using the provided cancellation context with the Inbox reply // for the data v. A response will be decoded into the vPtrResponse. func (c *EncodedConn) RequestWithContext(ctx context.Context, subject string, v interface{}, vPtr interface{}) error { - if ctx == nil { - panic("nil context") - } b, err := c.Enc.Encode(subject, v) if err != nil { return err