code: func NewUnitNameInfo(un string) *UnitNameInfo {
  
  	// Everything past the first @ and before the last . is the instance
  	s := strings.LastIndex(un, ".")
  	if s == -1 {
  		return nil
  	}
  
  	nu := &UnitNameInfo{FullName: un}
  	name := un[:s]
  	suffix := un[s:]
  	nu.Name = name
  
  	a := strings.Index(name, "@")
  	if a == -1 {
  		// This does not appear to be a template or instance unit.
  		nu.Prefix = name
  		return nu
  	}
  
  	nu.Prefix = name[:a]
  	nu.Template = fmt.Sprintf("%s@%s", name[:a], suffix)
  	nu.Instance = name[a+1:]
  	return nu
  }
docs: // NewUnitNameInfo generates a UnitNameInfo from the given name. If the given string
  // is not a correct unit name, nil is returned.