File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,13 @@ package mongo
3
3
import (
4
4
"context"
5
5
"errors"
6
+ "strconv"
7
+ "strings"
8
+
6
9
"go.mongodb.org/mongo-driver/bson"
7
10
"go.mongodb.org/mongo-driver/mongo"
8
11
"go.mongodb.org/mongo-driver/mongo/options"
9
12
"go.mongodb.org/mongo-driver/x/bsonx"
10
- "strconv"
11
- "strings"
12
13
13
14
"github.com/qa-dev/jsonwire-grid/config"
14
15
"github.com/qa-dev/jsonwire-grid/pool"
@@ -58,7 +59,7 @@ func (f *Factory) Create(cfg config.Config) (pool.StorageInterface, error) {
58
59
func checkServerVersion (ctx context.Context , client * mongo.Client ) error {
59
60
serverStatus , err := client .Database ("admin" ).RunCommand (
60
61
ctx ,
61
- bsonx.Doc {{ "serverStatus" , bsonx .Int32 (1 )}},
62
+ bsonx.Doc {bsonx. Elem { Key : "serverStatus" , Value : bsonx .Int32 (1 )}},
62
63
).DecodeBytes ()
63
64
if err != nil {
64
65
return err
@@ -69,7 +70,7 @@ func checkServerVersion(ctx context.Context, client *mongo.Client) error {
69
70
return err
70
71
}
71
72
72
- majorVersion , err := strconv .Atoi (strings .Split (version .StringValue (), "." )[0 ])
73
+ majorVersion , _ := strconv .Atoi (strings .Split (version .StringValue (), "." )[0 ])
73
74
if majorVersion < 4 {
74
75
return errors .New ("mongodb version not supported: " + version .StringValue ())
75
76
}
You can’t perform that action at this time.
0 commit comments