vsphere/internal/helper/folder/folder_helper.go
func validateDatastoreFolder(folder *object.Folder) (*object.Folder, error) {
	ft, err := FindType(folder)
	if err != nil {
		return nil, err
	}
	if ft != VSphereFolderTypeDatastore {
		return nil, fmt.Errorf("%q is not a datastore folder", folder.InventoryPath)
	}
	return folder, nil
}
func validateDatastoreFolder(folder *object.Folder) (*object.Folder, error) {
	ft, err := FindType(folder)
	if err != nil {
		return nil, err
	}
	if ft != VSphereFolderTypeDatastore {
		return nil, fmt.Errorf("%q is not a datastore folder", folder.InventoryPath)
	}
	return folder, nil
}
// validateDatastoreFolder checks to make sure the folder is a datastore
// folder, and returns it if it is, or an error if it isn't.