code: func (c *Client) addRequest(jReq *jsonRequest) error {
  	c.requestLock.Lock()
  	defer c.requestLock.Unlock()
  
  	// A non-blocking read of the shutdown channel with the request lock
  	// held avoids adding the request to the client's internal data
  	// structures if the client is in the process of shutting down (and
  	// has not yet grabbed the request lock), or has finished shutdown
  	// already (responding to each outstanding request with
  	// ErrClientShutdown).
  	select {
  	case <-c.shutdown:
  		return ErrClientShutdown
  	default:
  	}
  
  	element := c.requestList.PushBack(jReq)
  	c.requestMap[jReq.id] = element
  	return nil
  }
docs: // addRequest associates the passed jsonRequest with its id.  This allows the
  // response from the remote server to be unmarshalled to the appropriate type
  // and sent to the specified channel when it is received.
  //
  // If the client has already begun shutting down, ErrClientShutdown is returned
  // and the request is not added.
  //
  // This function is safe for concurrent access.