From e71bc31e306af60d18838253aed641f357a4b5c8 Mon Sep 17 00:00:00 2001 From: taako-502 Date: Mon, 12 Feb 2024 08:36:41 +0200 Subject: [PATCH 1/2] fix: should not pass nil to context --- migrate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migrate.go b/migrate.go index b1025e9..85ac11d 100644 --- a/migrate.go +++ b/migrate.go @@ -78,8 +78,8 @@ 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 } From d5472b1c7f581f10ce5245631b86f3002fc368f5 Mon Sep 17 00:00:00 2001 From: taako-502 Date: Mon, 12 Feb 2024 08:39:28 +0200 Subject: [PATCH 2/2] delete blank --- migrate.go | 1 - 1 file changed, 1 deletion(-) diff --git a/migrate.go b/migrate.go index 85ac11d..9e8d154 100644 --- a/migrate.go +++ b/migrate.go @@ -78,7 +78,6 @@ func (m *Migrate) createCollectionIfNotExist(name string) error { } command := bson.D{bson.E{Key: "create", Value: name}} - if err = m.db.RunCommand(context.TODO(), command).Err(); err != nil { return err }