removed capital Error to conform to Go Static Check

This commit is contained in:
0ceanSlim 2024-07-24 10:16:26 -04:00
parent 8ad674401b
commit d7631ff91a
3 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@ func HandleKind0(ctx context.Context, evt relay.Event, collection *mongo.Collect
var existingEvent relay.Event var existingEvent relay.Event
err := collection.FindOne(ctx, filter).Decode(&existingEvent) err := collection.FindOne(ctx, filter).Decode(&existingEvent)
if err != nil && err != mongo.ErrNoDocuments { 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 // 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 opts := options.Update().SetUpsert(true) // Insert if not found
_, err = collection.UpdateOne(ctx, filter, update, opts) _, err = collection.UpdateOne(ctx, filter, update, opts)
if err != nil { 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) fmt.Println("Upserted event kind 0 into MongoDB:", evt.ID)

View File

@ -13,7 +13,7 @@ func HandleKind1(ctx context.Context, evt relay.Event, collection *mongo.Collect
// Insert event into MongoDB // Insert event into MongoDB
_, err := collection.InsertOne(ctx, evt) _, err := collection.InsertOne(ctx, evt)
if err != nil { 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) fmt.Println("Inserted event kind 1 into MongoDB:", evt.ID)

View File

@ -11,7 +11,7 @@ import (
func HandleUnknownKind(ctx context.Context, evt relay.Event, collection *mongo.Collection) error { func HandleUnknownKind(ctx context.Context, evt relay.Event, collection *mongo.Collection) error {
_, err := collection.InsertOne(ctx, evt) _, err := collection.InsertOne(ctx, evt)
if err != nil { 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) fmt.Println("Inserted unknown event into MongoDB:", evt.ID)