Skip to content

Commit b55bc68

Browse files
committed
fixed indent
1 parent a9649e8 commit b55bc68

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

pkg/producers/mongoDB/mongoProducer.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ type Config struct {
1919
}
2020

2121
type MongoProducer struct {
22-
client mongo.Client
23-
database string
24-
collection string
22+
client mongo.Client
23+
database string
24+
collection string
2525
}
2626

2727
func (p *MongoProducer) Initialize(configFile string) {
@@ -69,8 +69,8 @@ func (p *MongoProducer) Produce(k []byte, v []byte, o interface{}) {
6969
}
7070

7171
func (p *MongoProducer) Close() {
72-
err := p.client.Disconnect(context.TODO())
73-
if err != nil {
74-
log.Fatalf("Failed to close Mongo connection:\n%s", err)
75-
}
72+
err := p.client.Disconnect(context.Background())
73+
if err != nil {
74+
log.Fatalf("Failed to close Mongo connection:\n%s", err)
75+
}
7676
}

pkg/producers/mongoDB/mongoProducer_test.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import (
99
)
1010

1111
func TestProducer_Initialize(t *testing.T) {
12-
configFile := "config.json.example"
13-
14-
producer, err := storage.ProducerFactory("mongo")
15-
if err != nil {
16-
t.Fatalf("Error reading configuration file: %v", err)
17-
}
18-
err = producer.Initialize(configFile)
19-
if err != nil {
20-
t.Fatalf("Error reading configuration file: %v", err)
12+
configFile := "config.json.example"
13+
14+
producer, err := storage.ProducerFactory("mongo")
15+
if err != nil {
16+
t.Fatalf("Error reading configuration file: %v", err)
17+
}
18+
err = producer.Initialize(configFile)
19+
if err != nil {
20+
t.Fatalf("Error reading configuration file: %v", err)
2121
}
2222
}
2323

0 commit comments

Comments
 (0)