code: func (c *Client) sendPostHandler() {
  out:
  	for {
  		// Send any messages ready for send until the shutdown channel
  		// is closed.
  		select {
  		case details := <-c.sendPostChan:
  			c.handleSendPostMessage(details)
  
  		case <-c.shutdown:
  			break out
  		}
  	}
  
  	// Drain any wait channels before exiting so nothing is left waiting
  	// around to send.
  cleanup:
  	for {
  		select {
  		case details := <-c.sendPostChan:
  			details.jsonRequest.responseChan <- &response{
  				result: nil,
  				err:    ErrClientShutdown,
  			}
  
  		default:
  			break cleanup
  		}
  	}
  	c.wg.Done()
  	log.Tracef("RPC client send handler done for %s", c.config.Host)
  
  }
docs: // sendPostHandler handles all outgoing messages when the client is running
  // in HTTP POST mode.  It uses a buffered channel to serialize output messages
  // while allowing the sender to continue running asynchronously.  It must be run
  // as a goroutine.