code: func (f *Finder) datacenterPath(ctx context.Context, ref types.ManagedObjectReference) (string, error) {
  	mes, err := mo.Ancestors(ctx, f.client, f.client.ServiceContent.PropertyCollector, ref)
  	if err != nil {
  		return "", err
  	}
  
  	// Chop leaves under the Datacenter
  	for i := len(mes) - 1; i > 0; i-- {
  		if mes[i].Self.Type == "Datacenter" {
  			break
  		}
  		mes = mes[:i]
  	}
  
  	var p string
  
  	for _, me := range mes {
  		// Skip root entity in building inventory path.
  		if me.Parent == nil {
  			continue
  		}
  
  		p = p + "/" + me.Name
  	}
  
  	return p, nil
  }
docs: // datacenterPath returns the absolute path to the Datacenter containing the given ref