Skip to content

Commit

Permalink
fix: Return slice of correct length from db.AddSchema (#2765)
Browse files Browse the repository at this point in the history
## Relevant issue(s)

Resolves #2764

## Description

Return slice of correct length from db.AddSchema, values are appended to
this slice later in the function, but the result declaration is done as
if they will be set by index.

Bug also affected `db.AddView`.
  • Loading branch information
AndrewSisley authored Jun 24, 2024
1 parent f895315 commit 281aa77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/db/collection_define.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (db *db) createCollections(
ctx context.Context,
newDefinitions []client.CollectionDefinition,
) ([]client.CollectionDefinition, error) {
returnDescriptions := make([]client.CollectionDefinition, len(newDefinitions))
returnDescriptions := make([]client.CollectionDefinition, 0, len(newDefinitions))

existingDefinitions, err := db.getAllActiveDefinitions(ctx)
if err != nil {
Expand Down

0 comments on commit 281aa77

Please sign in to comment.