Skip to content

Commit

Permalink
create container when contructing object
Browse files Browse the repository at this point in the history
  • Loading branch information
MGTheTrain committed Nov 18, 2024
1 parent 9687b1b commit d5ca80a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/infrastructure/connector/az_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ func NewAzureBlobConnector(connectionString string, containerName string) (*Azur
return nil, fmt.Errorf("failed to create Azure Blob client: %w", err)
}

_, err = client.CreateContainer(context.Background(), containerName, nil)
if err != nil {
fmt.Errorf("failed to create Azure container: %w", err) // The container may already exist, so we should not return an error in this case.

Check failure on line 42 in internal/infrastructure/connector/az_blob.go

View workflow job for this annotation

GitHub Actions / check-diffs

Error return value of `fmt.Errorf` is not checked (errcheck)
}

return &AzureBlobConnectorImpl{
Client: client,
ContainerName: containerName,
Expand Down

0 comments on commit d5ca80a

Please sign in to comment.