From 488ab8adf37183b3155c65e1db03ea0ed9b73416 Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Tue, 27 Sep 2022 20:46:05 -0700 Subject: [PATCH] fix warning in api/handlers/cow.go --- api/handlers/cow.go | 2 +- databases/database.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/handlers/cow.go b/api/handlers/cow.go index 1ea8826..e9c653d 100644 --- a/api/handlers/cow.go +++ b/api/handlers/cow.go @@ -130,7 +130,7 @@ func (c Cow) UpdateCowHandler(w http.ResponseWriter, r *http.Request) { return } - b, err := json.Marshal(dbResp) // TODO: get rid of this warning cause its bothering me + b, err := json.Marshal(dbResp) if err != nil { config.ErrorStatus("failed ot marshal response", http.StatusInternalServerError, w, err) return diff --git a/databases/database.go b/databases/database.go index d445934..e8ba5a4 100644 --- a/databases/database.go +++ b/databases/database.go @@ -66,7 +66,7 @@ type mongoInsertOneResult struct { } type mongoUpdateResult struct { - ur *mongo.UpdateResult + Ur *mongo.UpdateResult // capital to export field to ignore error in ../api/handlers/cow.go Ln 133 Col 26 } type mongoSession struct { @@ -132,7 +132,7 @@ func (mc *mongoCollection) UpdateOne(ctx context.Context, filter, update interfa if err != nil { return mongoUpdateResult{}, err } - return mongoUpdateResult{ur: updateOneResult}, nil + return mongoUpdateResult{Ur: updateOneResult}, nil } func (sr *mongoSingleResult) Decode(v interface{}) error {