code: func (r *Registry) newReference(item mo.Reference) types.ManagedObjectReference {
  	ref := item.Reference()
  
  	if ref.Type == "" {
  		ref.Type = typeName(item)
  	}
  
  	if ref.Value == "" {
  		n := atomic.AddInt64(&r.counter, 1)
  		ref.Value = fmt.Sprintf("%s-%d", valuePrefix(ref.Type), n)
  	}
  
  	return ref
  }
docs: // newReference returns a new MOR, where Type defaults to type of the given item
  // and Value defaults to a unique id for the given type.