azure: storageErr is already azblob.StorageError type

This commit is contained in:
Brian C. Lane 2022-09-09 11:17:41 -07:00 committed by Brian C. Lane
parent 7bae91eb9a
commit 561bbbbdf3

View file

@ -186,7 +186,7 @@ func (c StorageClient) CreateStorageContainerIfNotExist(ctx context.Context, sto
_, err := containerURL.Create(ctx, azblob.Metadata{}, azblob.PublicAccessNone)
if err != nil {
if storageErr, ok := err.(azblob.StorageError); ok && storageErr.(azblob.StorageError).ServiceCode() == azblob.ServiceCodeContainerAlreadyExists {
if storageErr, ok := err.(azblob.StorageError); ok && storageErr.ServiceCode() == azblob.ServiceCodeContainerAlreadyExists {
return nil
}
return fmt.Errorf("cannot create a storage container: %v", err)