Skip to content

Commit

Permalink
Merge pull request #21 from taako-502/fix-warning-context-nil
Browse files Browse the repository at this point in the history
fix: should not pass nil to context
  • Loading branch information
xakep666 committed Mar 25, 2024
2 parents 89856f5 + d5472b1 commit 7bc6412
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions migrate.go
Expand Up @@ -78,8 +78,7 @@ func (m *Migrate) createCollectionIfNotExist(name string) error {
}

command := bson.D{bson.E{Key: "create", Value: name}}
err = m.db.RunCommand(nil, command).Err()
if err != nil {
if err = m.db.RunCommand(context.TODO(), command).Err(); err != nil {
return err
}

Expand Down

0 comments on commit 7bc6412

Please sign in to comment.