code: func ValidateName(name string) error {
  	length := len(name)
  	if length == 0 {
  		return errors.New("unit name cannot be empty")
  	}
  	if length > unitNameMax {
  		return fmt.Errorf("unit name exceeds maximum length (%d)", unitNameMax)
  	}
  	dot := strings.LastIndex(name, ".")
  	if dot == -1 {
  		return errors.New(`unit name must contain "."`)
  	}
  	if dot == length-1 {
  		return errors.New(`unit name cannot end in "."`)
  	}
  	suffix := name[dot+1:]
  	if !validUnitTypes.Contains(suffix) {
  		return fmt.Errorf("invalid unit type: %q", suffix)
  	}
  	if strings.Contains(name, "@") && !validTemplateTypes.Contains(suffix) {
  		return fmt.Errorf("invalid unit type for template: %q", suffix)
  	}
  	for _, char := range name[:dot] {
  		if !strings.ContainsRune(validChars, char) {
  			return fmt.Errorf("invalid character %q in unit name", char)
  		}
  	}
  	if strings.HasPrefix(name, "@") {
  		return errors.New(`unit name cannot start in "@"`)
  	}
  	return nil
  }
docs: // ValidateName ensures that a given unit name is valid; if not, an error is
  // returned describing the first issue encountered.
  // systemd reference: `unit_name_is_valid` in `unit-name.c`