func (c *AzureClient) moveBlob(dstContainerName, dstBlobName, srcContainerName, srcBlobName string, isContainerRename bool) error {
	dstBlobUrl := c.blobClient.GetBlobUrl(dstContainerName, dstBlobName)
	srcBlobUrl := c.blobClient.GetBlobUrl(srcContainerName, srcBlobName)
	if dstBlobUrl != srcBlobUrl {
		err := c.blobClient.CopyBlob(dstContainerName, dstBlobName, srcBlobUrl)
		if err != nil {
			return err
		}
		if !isContainerRename {
			err = c.blobClient.DeleteBlob(srcContainerName, srcBlobName)
			if err != nil {
				return err
			}
		}
	}
	return nil
}
// Azure prevent user renaming their blob
// Thus this function firstly copy the source blob,
// when finished, delete the source blob.
// http://stackoverflow.com/questions/3734672/azure-storage-blob-rename
Azure prevent user renaming their blob
Thus this function firstly copy the source blob,
when finished, delete the source blob.
// Azure prevent user renaming their blob // Thus this function firstly copy the source blob // when finished delete the source blob . // http : // stackoverflow . com / questions / 3734672 / azure - storage - blob - rename
func (c *AzureClient) moveBlob(dstContainerName, dstBlobName, srcContainerName, srcBlobName string, isContainerRename bool) error {
	dstBlobUrl := c.blobClient.GetBlobUrl(dstContainerName, dstBlobName)
	srcBlobUrl := c.blobClient.GetBlobUrl(srcContainerName, srcBlobName)
	if dstBlobUrl != srcBlobUrl {
		err := c.blobClient.CopyBlob(dstContainerName, dstBlobName, srcBlobUrl)
		if err != nil {
			return err
		}
		if !isContainerRename {
			err = c.blobClient.DeleteBlob(srcContainerName, srcBlobName)
			if err != nil {
				return err
			}
		}
	}
	return nil
}
func ( c * AzureClient ) moveBlob ( dstContainerName , dstBlobName , srcContainerName , srcBlobName string , isContainerRename bool ) error { dstBlobUrl := c . blobClient . GetBlobUrl ( dstContainerName , dstBlobName ) srcBlobUrl := c . blobClient . GetBlobUrl ( srcContainerName , srcBlobName ) if dstBlobUrl != srcBlobUrl { err := c . blobClient . CopyBlob ( dstContainerName , dstBlobName , srcBlobUrl ) if err != nil { return err } if ! isContainerRename { err = c . blobClient . DeleteBlob ( srcContainerName , srcBlobName ) if err != nil { return err } } } return nil }
Azure prevent user renaming their blob
Thus this function firstly copy the source blob,
when finished, delete the source blob.
Azure prevent user renaming their blob Thus this function firstly copy the source blob when finished delete the source blob .