code: func (p *Process) Stop() (*os.ProcessState, error) {
  	select {
  	case <-p.stopped:
  		return p.cmd.ProcessState, p.stopErr
  	default:
  	}
  
  	if _, err := p.Post("/rest/system/shutdown", nil); err != nil && err != io.ErrUnexpectedEOF {
  		// Unexpected EOF is somewhat expected here, as we may exit before
  		// returning something sensible.
  		return nil, err
  	}
  
  	<-p.stopped
  
  	return p.cmd.ProcessState, p.stopErr
  }
docs: // Stop stops the running Syncthing process. If the process was logging to a
  // local file (set by LogTo), the log file will be opened and checked for
  // panics and data races. The presence of either will be signalled in the form
  // of a returned error.