vsphere/internal/helper/folder/folder_helper.go
func VirtualMachineFolderFromObject(client *govmomi.Client, obj interface{}, relative string) (*object.Folder, error) {
	log.Printf("[DEBUG] Locating folder at path %q relative to virtual machine root", relative)
	folder, err := folderFromObject(client, obj, RootPathParticleVM, relative)
	if err != nil {
		return nil, err
	}

	return validateVirtualMachineFolder(folder)
}
func VirtualMachineFolderFromObject(client *govmomi.Client, obj interface{}, relative string) (*object.Folder, error) {
	log.Printf("[DEBUG] Locating folder at path %q relative to virtual machine root", relative)
	folder, err := folderFromObject(client, obj, RootPathParticleVM, relative)
	if err != nil {
		return nil, err
	}

	return validateVirtualMachineFolder(folder)
}
// VirtualMachineFolderFromObject returns an *object.Folder from a given
// object, and relative datastore folder path. If no such folder is found, or
// if it is not a VM folder, an appropriate error will be returned.