vsphere/internal/helper/folder/folder_helper.go
func FromPath(c *govmomi.Client, p string, ft VSphereFolderType, dc *object.Datacenter) (*object.Folder, error) {
	var fp string
	if ft == VSphereFolderTypeDatacenter {
		fp = "/" + p
	} else {
		pt := RootPathParticle(ft)
		fp = pt.PathFromDatacenter(dc, p)
	}
	return FromAbsolutePath(c, fp)
}
func FromPath(c *govmomi.Client, p string, ft VSphereFolderType, dc *object.Datacenter) (*object.Folder, error) {
	var fp string
	if ft == VSphereFolderTypeDatacenter {
		fp = "/" + p
	} else {
		pt := RootPathParticle(ft)
		fp = pt.PathFromDatacenter(dc, p)
	}
	return FromAbsolutePath(c, fp)
}
func FromPath ( c * govmomi . Client , p string , ft VSphereFolderType , dc * object . Datacenter ) ( * object . Folder , error ) { var fp string if ft == VSphereFolderTypeDatacenter { fp = " " + p } else { pt := RootPathParticle ( ft ) fp = pt . PathFromDatacenter ( dc , p ) } return FromAbsolutePath ( c , fp ) }
// FromPath takes a relative folder path, an object type, and an optional
// supplied datacenter, and returns the respective *object.Folder if it exists.
//
// The datacenter supplied in dc cannot be nil if the folder type supplied by
// ft is something else other than VSphereFolderTypeDatacenter.
FromPath takes a relative folder path an object type and an optional supplied datacenter and returns the respective * object . Folder if it exists . The datacenter supplied in dc cannot be nil if the folder type supplied by ft is something else other than VSphereFolderTypeDatacenter .