code: func dvsFromPath(client *govmomi.Client, name string, dc *object.Datacenter) (*object.VmwareDistributedVirtualSwitch, error) {
  	net, err := network.FromPath(client, name, dc)
  	if err != nil {
  		return nil, err
  	}
  	if net.Reference().Type != "VmwareDistributedVirtualSwitch" {
  		return nil, fmt.Errorf("network at path %q is not a VMware distributed virtual switch (type %s)", name, net.Reference().Type)
  	}
  	return dvsFromMOID(client, net.Reference().Value)
  }
docs: // dvsFromPath gets a DVS object from its path.