code: func (ss *FileSubStore) DeleteSub(subid uint64) error {
  	ss.Lock()
  	ss.delSub.ID = subid
  	err := ss.writeRecord(nil, subRecDel, &ss.delSub)
  	// Even if there is an error, continue with cleanup. If later
  	// a compact is successful, the sub won't be present in the compacted file.
  	if si, exists := ss.subs[subid]; exists {
  		s := si.(*subscription)
  		delete(ss.subs, subid)
  		// writeRecord has already accounted for the count of the
  		// delete record. We add to this the number of pending messages
  		ss.delRecs += len(s.seqnos)
  		// Check if this triggers a need for compaction
  		if ss.shouldCompact() {
  			ss.fm.closeFileIfOpened(ss.file)
  			ss.compact(ss.file.name)
  		}
  	}
  	ss.Unlock()
  	return err
  }
docs: // DeleteSub invalidates this subscription.