code: func (fm *filesManager) remove(file *file) bool {
  	fm.Lock()
  	wasOpened, err := fm.trySwitchState(file, fileRemoved)
  	if err != nil {
  		fm.Unlock()
  		return false
  	}
  	// With code above, we can't be removing a file twice, so no need to check if
  	// file is present in map.
  	delete(fm.files, file.id)
  	if wasOpened {
  		fm.openedFDs--
  	}
  	fm.Unlock()
  	return true
  }
docs: // remove a file from the list of files. The initial state must be either `fileOpened`
  // or `fileClosed`. This call will loop until it can switch the file's state from
  // one of these states to `fileRemoved`, or return an error if the change can't
  // be made after a certain number of attempts.
  // When removed, this call returns true and the given `file` is untouched (except
  // for its state). So it is still possible for caller to read/write (if handle is
  // valid) or close this file.