code: func (e *Environment) Wait() error {
  	<-e.stopCh
  	if log.Enabled(log.LvDebug) {
  		log.Debug("well: waiting for all goroutines to complete", nil)
  	}
  	e.wg.Wait()
  	e.cancel() // in case no one calls Cancel
  
  	e.mu.Lock()
  	defer e.mu.Unlock()
  
  	return e.err
  }
docs: // Wait waits for Stop or Cancel, and for all goroutines started by
  // Go to finish.
  //
  // The returned err is the one passed to Cancel, or nil.
  // err can be tested by IsSignaled to determine whether the
  // program got SIGINT or SIGTERM.