code: func (c *Client) Close() error {
  	if c == nil {
  		return fmt.Errorf("Client is nil")
  	}
  	select {
  	case c.stop <- struct{}{}:
  	default:
  	}
  
  	// if this client is buffered, flush before closing the writer
  	if c.bufferLength > 0 {
  		if err := c.Flush(); err != nil {
  			return err
  		}
  	}
  
  	return c.writer.Close()
  }
docs: // Close the client connection.