code: func FromPath(client *govmomi.Client, name string, dc *object.Datacenter) (*object.DistributedVirtualPortgroup, error) {
  	finder := find.NewFinder(client.Client, false)
  	if dc != nil {
  		finder.SetDatacenter(dc)
  	}
  
  	ctx, cancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout)
  	defer cancel()
  	net, err := finder.Network(ctx, name)
  	if err != nil {
  		return nil, err
  	}
  	if net.Reference().Type != "DistributedVirtualPortgroup" {
  		return nil, fmt.Errorf("network at path %q is not a portgroup (type %s)", name, net.Reference().Type)
  	}
  	return FromMOID(client, net.Reference().Value)
  }
docs: // FromPath gets a portgroup object from its path.