code: func (nc *Conn) unsubscribe(sub *Subscription, max int, drainMode bool) error {
  	nc.mu.Lock()
  	// ok here, but defer is expensive
  	defer nc.mu.Unlock()
  	defer nc.kickFlusher()
  
  	if nc.isClosed() {
  		return ErrConnectionClosed
  	}
  
  	nc.subsMu.RLock()
  	s := nc.subs[sub.sid]
  	nc.subsMu.RUnlock()
  	// Already unsubscribed
  	if s == nil {
  		return nil
  	}
  
  	maxStr := _EMPTY_
  	if max > 0 {
  		s.max = uint64(max)
  		maxStr = strconv.Itoa(max)
  	} else if !drainMode {
  		nc.removeSub(s)
  	}
  
  	if drainMode {
  		go nc.checkDrained(sub)
  	}
  
  	// We will send these for all subs when we reconnect
  	// so that we can suppress here.
  	if !nc.isReconnecting() {
  		fmt.Fprintf(nc.bw, unsubProto, s.sid, maxStr)
  	}
  	return nil
  }
docs: // unsubscribe performs the low level unsubscribe to the server.
  // Use Subscription.Unsubscribe()