mirror of
https://github.com/0ceanSlim/grain.git
synced 2024-10-29 17:16:31 +00:00
removed capital Error to conform to Go Static Check
This commit is contained in:
parent
8ad674401b
commit
d7631ff91a
@ -18,7 +18,7 @@ func HandleKind0(ctx context.Context, evt relay.Event, collection *mongo.Collect
|
||||
var existingEvent relay.Event
|
||||
err := collection.FindOne(ctx, filter).Decode(&existingEvent)
|
||||
if err != nil && err != mongo.ErrNoDocuments {
|
||||
return fmt.Errorf("Error finding existing event: %v", err)
|
||||
return fmt.Errorf("error finding existing event: %v", err)
|
||||
}
|
||||
|
||||
// If an existing event is found, compare the created_at times
|
||||
@ -45,7 +45,7 @@ func HandleKind0(ctx context.Context, evt relay.Event, collection *mongo.Collect
|
||||
opts := options.Update().SetUpsert(true) // Insert if not found
|
||||
_, err = collection.UpdateOne(ctx, filter, update, opts)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error updating/inserting event kind 0 into MongoDB: %v", err)
|
||||
return fmt.Errorf("error updating/inserting event kind 0 into MongoDB: %v", err)
|
||||
}
|
||||
|
||||
fmt.Println("Upserted event kind 0 into MongoDB:", evt.ID)
|
||||
|
@ -13,7 +13,7 @@ func HandleKind1(ctx context.Context, evt relay.Event, collection *mongo.Collect
|
||||
// Insert event into MongoDB
|
||||
_, err := collection.InsertOne(ctx, evt)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error inserting event into MongoDB: %v", err)
|
||||
return fmt.Errorf("error inserting event into MongoDB: %v", err)
|
||||
}
|
||||
|
||||
fmt.Println("Inserted event kind 1 into MongoDB:", evt.ID)
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
func HandleUnknownKind(ctx context.Context, evt relay.Event, collection *mongo.Collection) error {
|
||||
_, err := collection.InsertOne(ctx, evt)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error inserting unknown event into MongoDB: %v", err)
|
||||
return fmt.Errorf("error inserting unknown event into MongoDB: %v", err)
|
||||
}
|
||||
|
||||
fmt.Println("Inserted unknown event into MongoDB:", evt.ID)
|
||||
|
Loading…
Reference in New Issue
Block a user