code: func (a *Agent) removeCheckLocked(checkID types.CheckID, persist bool) error {
  	// Validate CheckID
  	if checkID == "" {
  		return fmt.Errorf("CheckID missing")
  	}
  
  	a.cancelCheckMonitors(checkID)
  	a.State.RemoveCheck(checkID)
  
  	if persist {
  		if err := a.purgeCheck(checkID); err != nil {
  			return err
  		}
  		if err := a.purgeCheckState(checkID); err != nil {
  			return err
  		}
  	}
  	a.logger.Printf("[DEBUG] agent: removed check %q", checkID)
  	return nil
  }
docs: // removeCheckLocked is used to remove a health check.
  // The agent will make a best effort to ensure it is deregistered