code: func (a *Agent) deletePid() error {
  	// Quit fast if no pidfile
  	pidPath := a.config.PidFile
  	if pidPath == "" {
  		return nil
  	}
  
  	stat, err := os.Stat(pidPath)
  	if err != nil {
  		return fmt.Errorf("Could not remove pid file: %s", err)
  	}
  
  	if stat.IsDir() {
  		return fmt.Errorf("Specified pid file path is directory")
  	}
  
  	err = os.Remove(pidPath)
  	if err != nil {
  		return fmt.Errorf("Could not remove pid file: %s", err)
  	}
  	return nil
  }
docs: // deletePid is used to delete our PID on exit