Skip to content

Commit d1efe16

Browse files
committed
lint fixes
1 parent 676224e commit d1efe16

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

storage/mongo/factory.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package mongo
33
import (
44
"context"
55
"errors"
6+
"strconv"
7+
"strings"
8+
69
"go.mongodb.org/mongo-driver/bson"
710
"go.mongodb.org/mongo-driver/mongo"
811
"go.mongodb.org/mongo-driver/mongo/options"
912
"go.mongodb.org/mongo-driver/x/bsonx"
10-
"strconv"
11-
"strings"
1213

1314
"github.com/qa-dev/jsonwire-grid/config"
1415
"github.com/qa-dev/jsonwire-grid/pool"
@@ -58,7 +59,7 @@ func (f *Factory) Create(cfg config.Config) (pool.StorageInterface, error) {
5859
func checkServerVersion(ctx context.Context, client *mongo.Client) error {
5960
serverStatus, err := client.Database("admin").RunCommand(
6061
ctx,
61-
bsonx.Doc{{"serverStatus", bsonx.Int32(1)}},
62+
bsonx.Doc{bsonx.Elem{Key: "serverStatus", Value: bsonx.Int32(1)}},
6263
).DecodeBytes()
6364
if err != nil {
6465
return err
@@ -69,7 +70,7 @@ func checkServerVersion(ctx context.Context, client *mongo.Client) error {
6970
return err
7071
}
7172

72-
majorVersion, err := strconv.Atoi(strings.Split(version.StringValue(), ".")[0])
73+
majorVersion, _ := strconv.Atoi(strings.Split(version.StringValue(), ".")[0])
7374
if majorVersion < 4 {
7475
return errors.New("mongodb version not supported: " + version.StringValue())
7576
}

0 commit comments

Comments
 (0)