code: func lazyCreateUnits(cCmd *cobra.Command, args []string) error {
  	errchan := make(chan error)
  	blockAttempts, _ := cCmd.Flags().GetInt("block-attempts")
  	var wg sync.WaitGroup
  	for _, arg := range args {
  		arg = maybeAppendDefaultUnitType(arg)
  		name := unitNameMangle(arg)
  
  		ret, err := checkUnitCreation(cCmd, arg)
  		if err != nil {
  			return err
  		} else if ret != 0 {
  			continue
  		}
  
  		// Assume that the name references a local unit file on
  		// disk or if it is an instance unit and if so get its
  		// corresponding unit
  		uf, err := getUnitFile(cCmd, arg)
  		if err != nil {
  			return err
  		}
  
  		_, err = createUnit(name, uf)
  		if err != nil {
  			return err
  		}
  
  		wg.Add(1)
  		go checkUnitState(name, job.JobStateInactive, blockAttempts, os.Stdout, &wg, errchan)
  	}
  
  	go func() {
  		wg.Wait()
  		close(errchan)
  	}()
  
  	haserr := false
  	for msg := range errchan {
  		stderr("Error waiting on unit creation: %v", msg)
  		haserr = true
  	}
  
  	if haserr {
  		return fmt.Errorf("One or more errors creating units")
  	}
  
  	return nil
  }
docs: // lazyCreateUnits iterates over a set of unit names and, for each, attempts to
  // ensure that a unit by that name exists in the Registry, by checking a number
  // of conditions and acting on the first one that succeeds, in order of:
  //  1. a unit by that name already existing in the Registry
  //  2. a unit file by that name existing on disk
  //  3. a corresponding unit template (if applicable) existing in the Registry
  //  4. a corresponding unit template (if applicable) existing on disk
  // Any error encountered during these steps is returned immediately (i.e.
  // subsequent Jobs are not acted on). An error is also returned if none of the
  // above conditions match a given Job.